Skip to content

Commit

Permalink
feat(webpack): add continuous inference support (#29974)
Browse files Browse the repository at this point in the history
## Current Behavior
Webpack Inference Plugin does not currently infer `continuous` for
`serve, preview, serve-static` targets.

## Expected Behavior
Webpack Inference Plugin correctly infers `continuous: true`
  • Loading branch information
Coly010 authored and FrozenPandaz committed Feb 20, 2025
1 parent d82e7ef commit 1e6e8ad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ exports[`@nx/webpack/plugin should create nodes 1`] = `
},
"my-serve": {
"command": "webpack-cli serve",
"continuous": true,
"metadata": {
"description": "Starts Webpack dev server",
"help": {
Expand All @@ -85,6 +86,7 @@ exports[`@nx/webpack/plugin should create nodes 1`] = `
},
"preview-site": {
"command": "webpack-cli serve",
"continuous": true,
"metadata": {
"description": "Starts Webpack dev server in production mode",
"help": {
Expand All @@ -110,6 +112,7 @@ exports[`@nx/webpack/plugin should create nodes 1`] = `
},
},
"serve-static": {
"continuous": true,
"dependsOn": [
"build-something",
],
Expand Down
3 changes: 3 additions & 0 deletions packages/webpack/src/plugins/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ async function createWebpackTargets(
};

targets[options.serveTargetName] = {
continuous: true,
command: `webpack-cli serve`,
options: {
cwd: projectRoot,
Expand All @@ -237,6 +238,7 @@ async function createWebpackTargets(
};

targets[options.previewTargetName] = {
continuous: true,
command: `webpack-cli serve`,
options: {
cwd: projectRoot,
Expand All @@ -257,6 +259,7 @@ async function createWebpackTargets(
};

targets[options.serveStaticTargetName] = {
continuous: true,
dependsOn: [options.buildTargetName],
executor: '@nx/web:file-server',
options: {
Expand Down

0 comments on commit 1e6e8ad

Please sign in to comment.