feat(nuxt): enable continuous tasks (#30925)

## Current Behavior
The tasks inferred by the `@nx/nuxt/plugin` do not set `continuous:true`
for serve-like tasks.

## Expected Behavior
The tasks should be correctly inferred with `continuous:true`.
This commit is contained in:
Colum Ferry 2025-04-29 21:44:00 +01:00 committed by GitHub
parent 307c45542a
commit 57724d3df9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 0 deletions

View File

@ -30,6 +30,7 @@ exports[`@nx/nuxt/plugin not root project should create nodes 1`] = `
], ],
}, },
"acme-serve-static": { "acme-serve-static": {
"continuous": true,
"executor": "@nx/web:file-server", "executor": "@nx/web:file-server",
"options": { "options": {
"buildTarget": "acme-build-static", "buildTarget": "acme-build-static",
@ -68,6 +69,7 @@ exports[`@nx/nuxt/plugin not root project should create nodes 1`] = `
}, },
"my-serve": { "my-serve": {
"command": "nuxt dev", "command": "nuxt dev",
"continuous": true,
"options": { "options": {
"cwd": "my-app", "cwd": "my-app",
}, },
@ -144,11 +146,13 @@ exports[`@nx/nuxt/plugin root project should create nodes 1`] = `
}, },
"serve": { "serve": {
"command": "nuxt dev", "command": "nuxt dev",
"continuous": true,
"options": { "options": {
"cwd": ".", "cwd": ".",
}, },
}, },
"serve-static": { "serve-static": {
"continuous": true,
"executor": "@nx/web:file-server", "executor": "@nx/web:file-server",
"options": { "options": {
"buildTarget": "build-static", "buildTarget": "build-static",

View File

@ -182,6 +182,7 @@ function serveTarget(projectRoot: string) {
options: { options: {
cwd: projectRoot, cwd: projectRoot,
}, },
continuous: true,
}; };
return targetConfig; return targetConfig;
@ -189,6 +190,7 @@ function serveTarget(projectRoot: string) {
function serveStaticTarget(options: NuxtPluginOptions) { function serveStaticTarget(options: NuxtPluginOptions) {
const targetConfig: TargetConfiguration = { const targetConfig: TargetConfiguration = {
continuous: true,
executor: '@nx/web:file-server', executor: '@nx/web:file-server',
options: { options: {
buildTarget: `${options.buildStaticTargetName}`, buildTarget: `${options.buildStaticTargetName}`,