Skip to content

Commit

Permalink
feat(rspack): add continous inference support (#29973)
Browse files Browse the repository at this point in the history
## Current Behavior
Rspack and Rsbuild Inference Plugins do not infer `continuous` for serve
tasks.

## Expected Behavior
Correctly infer `continuous` true.
  • Loading branch information
Coly010 authored and FrozenPandaz committed Feb 20, 2025
1 parent 0d9f4d2 commit d82e7ef
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/rsbuild/src/plugins/plugin.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ describe('@nx/rsbuild', () => {
},
"dev-serve": {
"command": "rsbuild dev",
"continuous": true,
"options": {
"args": [
"--mode=development",
Expand All @@ -131,6 +132,7 @@ describe('@nx/rsbuild', () => {
},
"preview-serve": {
"command": "rsbuild preview",
"continuous": true,
"dependsOn": [
"build-something",
"^build-something",
Expand Down
2 changes: 2 additions & 0 deletions packages/rsbuild/src/plugins/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ async function createRsbuildTargets(
};

targets[options.devTargetName] = {
continuous: true,
command: `rsbuild dev`,
options: {
cwd: projectRoot,
Expand All @@ -195,6 +196,7 @@ async function createRsbuildTargets(
};

targets[options.previewTargetName] = {
continuous: true,
command: `rsbuild preview`,
dependsOn: [`${options.buildTargetName}`, `^${options.buildTargetName}`],
options: {
Expand Down
3 changes: 3 additions & 0 deletions packages/rspack/src/plugins/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ async function createRspackTargets(
};

targets[options.serveTargetName] = {
continuous: true,
command: `rspack serve`,
options: {
cwd: projectRoot,
Expand All @@ -205,6 +206,7 @@ async function createRspackTargets(
};

targets[options.previewTargetName] = {
continuous: true,
command: `rspack serve`,
options: {
cwd: projectRoot,
Expand All @@ -213,6 +215,7 @@ async function createRspackTargets(
};

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

0 comments on commit d82e7ef

Please sign in to comment.