Created
May 23, 2019 11:31
-
-
Save dmrub/8f125ff1ac034e4a0c7227cdb77208e2 to your computer and use it in GitHub Desktop.
angular-webpack-patch.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://gist.github.com/niespodd/1fa82da6f8c901d1c33d2fcbb762947d | |
const fs = require('fs'); | |
const f = 'node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs/browser.js'; | |
fs.readFile(f, 'utf8', function (err,data) { | |
if (err) { | |
return console.log(err); | |
} | |
var result = data.replace(/node: false/g, 'node: {crypto: true, stream: true, fs: \'empty\'}'); | |
fs.writeFile(f, result, 'utf8', function (err) { | |
if (err) return console.log(err); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment