Skip to content

Instantly share code, notes, and snippets.

@hanssens
Forked from niespodd/package.json
Created March 2, 2019 08:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hanssens/868f13d054a8de4fd850d57bba1c4b79 to your computer and use it in GitHub Desktop.
Save hanssens/868f13d054a8de4fd850d57bba1c4b79 to your computer and use it in GitHub Desktop.
Making web3/bitcore-lib work with Angular 6
{...
"scripts": {
"postinstall": "node patch.js",
...
}
}
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.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