Schema for internal use only

Please do not extend this schema as it is part of Nx internal usage.

@nx/webpack:webpack-project

Add Webpack Configuration to a project.

Usage

nx generate webpack-project ...

By default, Nx will search for webpack-project in the default collection provisioned in workspace.json.

You can specify the collection explicitly as follows:

nx g @nx/webpack:webpack-project ...
Nx 15 and lower use @nrwl/ instead of @nx/

Show what will be generated without writing to disk:

nx g webpack-project ... --dry-run

Options

main

string

Path relative to the workspace root for the main entry file. Defaults to '<projectRoot>/src/main.ts'.

project

string

The name of the project.

tsConfig

string

Path relative to the workspace root for the tsconfig file to build with. Defaults to '<projectRoot>/tsconfig.app.json'.

babelConfig

string

Optionally specify a path relative to workspace root to the babel configuration file of your project.

compiler

string
Default: babel
Accepted values: babel, swc, tsc

The compiler to use to build source.

devServer

boolean
Default: false

Add a serve target to run a local webpack dev-server

target

string
Default: web
Accepted values: node, web

Target platform for the build, same as the Webpack config option.

skipFormat

boolean
Default: false

Skip formatting files.

skipPackageJson

boolean
Default: false

Do not add dependencies to package.json.

skipValidation

boolean
Default: false

Do not perform any validation on existing project.

webpackConfig

string

Path relative to workspace root to a custom webpack file that takes a config object and returns an updated config.