DEV Community

Don
Don

Posted on

1 2

Customize Angular Webpack config

  1. add customWebpackConfig to angular.json

    {
        "projects": {
            "architect": {
                "build": {
                    "options": {
                      "customWebpackConfig": {
              "path": "./custom-webpack.config.js",
              "replaceDuplicatePlugins": true
            },
                    }
                }
            }
        }
    }
    
  2. add the extra webpack plugin config in the custom-webpack.config.js

    module.exports = {
        module: {
            rules: [
                {
                    test: /\.js$/,
                    loader: 'babel-loader',
                    query: {
                        presets: ['@babel/preset-env'
                        ]
                    }
                }
            ]
        }
    }
    
    

Top comments (0)

👋 Kindness is contagious

Value this insightful article and join the thriving DEV Community. Developers of every skill level are encouraged to contribute and expand our collective knowledge.

A simple “thank you” can uplift someone’s spirits. Leave your appreciation in the comments!

On DEV, exchanging expertise lightens our path and reinforces our bonds. Enjoyed the read? A quick note of thanks to the author means a lot.

Okay