Skip to content

Instantly share code, notes, and snippets.

@eusthace811
Forked from niespodd/package.json
Created April 10, 2019 11:51
Show Gist options
  • Save eusthace811/11567eca7caf7b986c94a24e4997068c to your computer and use it in GitHub Desktop.
Save eusthace811/11567eca7caf7b986c94a24e4997068c to your computer and use it in GitHub Desktop.

Revisions

  1. @niespodd niespodd revised this gist May 6, 2018. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions package.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    {...
    "scripts": {
    "postinstall": "node patch.js",
    ...
    }
    }
  2. @niespodd niespodd created this gist May 6, 2018.
    13 changes: 13 additions & 0 deletions patch.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    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);
    });
    });