node-archiver icon indicating copy to clipboard operation
node-archiver copied to clipboard

[Bug] Use with Angular

Open danielehrhardt opened this issue 6 years ago • 0 comments

If i try to use node-archiver inside Angular i get this Error: input source must be valid Stream or Buffer instance

I think it is related to: https://github.com/archiverjs/node-archiver/issues/349 https://github.com/webpack/webpack/issues/1815

Workaround: npm i @angular-builders/custom-webpack -D npm i @angular-builders/dev-server -D Create a File in the Root called: custom-webpack.config.js Add this to the File:

module.exports = {
  externals: {
    archiver: "require('archiver')"
  }
};

Change the angular.json

"architect": {
  "build": {
    "builder": "@angular-builders/custom-webpack:browser",
    "options": {
      "customWebpackConfig": {
        "path": "./custom-webpack.config.js",
        "replaceDuplicatePlugins": true
      }
    }
  }
}
"serve": {
  "builder": "@angular-builders/custom-webpack:dev-server"
}

danielehrhardt avatar Dec 22 '19 15:12 danielehrhardt