Skip to content

Commit

Permalink
Merge branch '1.0' into issue/2289
Browse files Browse the repository at this point in the history
  • Loading branch information
nivida authored Feb 4, 2019
2 parents 4e927df + e0a8e11 commit 0c8fd5d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ jest.config.js
jest.preprocessor.js
W3cWebsocket.js
packages/**/rollup.config.js
angular-patch.js
6 changes: 3 additions & 3 deletions packages/web3/angular-patch.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
const fs = require('fs');
const f = '../../node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs/browser.js';

// This is because we have to replace the `node:false` in the `/angular-cli-files/models/webpack-configs/browser.js`
// This is because we have to replace the `node:false` in the `/angular-cli-files/models/webpack-configs/browser.js`
// with `node: {crypto: true, stream: true}` to allow web3 to work with angular (as they enforce node: false.)
// as explained here - https://github.com/ethereum/web3.js/issues/2260#issuecomment-458519127
if (fs.existsSync(f)) {
fs.readFile(f, 'utf8', function (err, data) {
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) {
fs.writeFile(f, result, 'utf8', function(err) {
if (err) return console.log(err);
});
});
Expand Down

0 comments on commit 0c8fd5d

Please sign in to comment.