nx/packages/angular/docs/webpack-dev-server-examples.md
2023-11-07 15:45:42 -05:00

814 B

Seving an application with a custom webpack configuration

This executor should be used along with @nx/angular:webpack-browser to serve an application using a custom webpack configuration.

Your project.json file should contain a build and serve target that matches the following:

"build": {
    "executor": "@nx/angular:webpack-browser",
    "options": {
        ...
        "customWebpackConfig": {
          "path": "apps/appName/webpack.config.js"
        }
    }
},
"serve": {
    "executor": "@nx/angular:webpack-dev-server",
    "configurations": {
        "production": {
            "buildTarget": "appName:build:production"
        },
        "development": {
            "buildTarget": "appName:build:development"
        }
    },
    "defaultConfiguration": "development",
}