angular-custom-webpack-chaining

0.1200.4 • Public • Published

Angular Custom Webpack Chaining

This is a package extends @angular-builders/custom-webpack for chaining webpack config function.

Support

Angular 12++

Install

$ ng add angular-custom-webpack-chaining

Add webpack file path to customWebpackConfig.chain in angular.json

"projects": {
  "app": {
    "architect": {
      "browser": {
        "build": {
          "builder": "angular-custom-webpack-chaining:browser",
        },
        "options": {
          "customWebpackConfig": {
            "chain": [
              "plugin-a.config.js",
              "plugin-b.config.js"
            ]
          }
        }
      }
    }
  }
}

plugin-a.config.js

const webpack = require('webpack');

module.exports = (config, options, targetOptions) => ({
  ...config, plugins: [...config.plugins, PLUGIN_A],
});

plugin-b.config.js

const webpack = require('webpack');

module.exports = (config, options, targetOptions) => ({
  ...config, plugins: [...config.plugins, PLUGIN_B],
});

output webpack config is following.

{
  plugins: [PLUGIN_A, PLUGIN_B]
}

Readme

Keywords

Package Sidebar

Install

npm i angular-custom-webpack-chaining

Weekly Downloads

61

Version

0.1200.4

License

MIT

Unpacked Size

89.4 kB

Total Files

65

Last publish

Collaborators

  • nontan