Skip to content

Instantly share code, notes, and snippets.

@dmrub
Created May 23, 2019 11:31
Show Gist options
  • Save dmrub/8f125ff1ac034e4a0c7227cdb77208e2 to your computer and use it in GitHub Desktop.
Save dmrub/8f125ff1ac034e4a0c7227cdb77208e2 to your computer and use it in GitHub Desktop.
angular-webpack-patch.js
// 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