Search code examples
angularwebpackangular-e2engx-build-plus

How to run e2e test with ngx-build-plus (extra-webpack-config)?


I use ngx-build-plus to include a special webpack loader to integrate special custom files into our Angular-CLI build process (Angular 10).

Everything works fine, however I couldn't find a way to use e2e-tests this way, it's not even taking the --extra-webpack-config option...

$ ng e2e --extra-webpack-config webpack.partial.js
Unknown option: '--extra-webpack-config'
Unknown option: 'webpack.partial.js'

How could I fix the e2e tests to use the webpack.partial.js ?


Solution

  • After many things I've tried I couldn't find out how to get it to work with ngx-build-plus at all. However, I found out there is a different module @angular-builders/custom-webpack which provides exact the functionality of seamlessly extending an Angular-CLI webpack configuration and worked perfectly with my e2e-tests. There is no need to pass arguments to the build process, as the name of the webpack.conf fragment s configured in the angular.json config file:

    "customWebpackConfig": {
        "path": "./webpack.config.js"
    }