Nx plugin to infer Web Dev Server in a workspace.
Note that @web/dev-server
has not released a 1.0.0
yet.
npm i -D @robby-rabbitman/nx-plus-web-dev-server
nx g @robby-rabbitman/nx-plus-web-dev-server:init
Projects with a Web Dev Server now have a serve target.
nx run {{project}}:serve
Adds @robby-rabbitman/nx-plus-web-dev-server/plugin
to the plugins
in the nx.json
.
nx g @robby-rabbitman/nx-plus-web-dev-server:init
Option | Type | Default | Description |
---|---|---|---|
serve-target-name | string | 'serve' | The name of the Web Dev Server target. |
skip-format | boolean | false | Whether to skip formatting the updated files. |
skip-add-plugin | boolean | false | Whether to skip adding the plugin. |
Adds a serve target for projects that have a Web Dev Server config file in their root, the plugin infers a Web Dev Server with one of the following names.
web-dev-server.config.js
web-dev-server.config.cjs
web-dev-server.config.mjs
wds.config.js
wds.config.cjs
wds.config.mjs
// nx.json
"plugins": [
{
"plugin": "@robby-rabbitman/nx-plus-web-dev-server/plugin",
"options": {
// the name of the web dev server target => nx run {{project}}:serve
"serveTargetName": "serve",
// the default configuration of the web dev server targets inferred by this plugin
"serveTargetConfig": {
"options":{
"node-resolve": true
}
}
}
},
]
serveTargetConfig
is different from targetDefaults since it applies only to the inferred targets and not every target.