feat(storybook): infer continuous tasks for storybook serve and serve-static (#30069)
## Current Behavior The `@nx/storybook/plugin` does not set `continuous:true` for serve-like targets. ## Expected Behavior The plugin should correctly set `continuous: true` for `serve` and `serve-static`.
This commit is contained in:
parent
7989e39461
commit
f5e124972a
@ -97,11 +97,13 @@ describe('@nx/storybook/plugin', () => {
|
||||
},
|
||||
"serve-storybook": {
|
||||
"command": "storybook dev",
|
||||
"continuous": true,
|
||||
"options": {
|
||||
"cwd": "my-app",
|
||||
},
|
||||
},
|
||||
"static-storybook": {
|
||||
"continuous": true,
|
||||
"executor": "@nx/web:file-server",
|
||||
"options": {
|
||||
"buildTarget": "build-storybook",
|
||||
@ -175,6 +177,7 @@ describe('@nx/storybook/plugin', () => {
|
||||
],
|
||||
},
|
||||
"serve-storybook": {
|
||||
"continuous": true,
|
||||
"executor": "@storybook/angular:start-storybook",
|
||||
"options": {
|
||||
"browserTarget": "my-ng-app:build-storybook",
|
||||
@ -183,6 +186,7 @@ describe('@nx/storybook/plugin', () => {
|
||||
},
|
||||
},
|
||||
"static-storybook": {
|
||||
"continuous": true,
|
||||
"executor": "@nx/web:file-server",
|
||||
"options": {
|
||||
"buildTarget": "build-storybook",
|
||||
@ -257,11 +261,13 @@ describe('@nx/storybook/plugin', () => {
|
||||
},
|
||||
"serve-storybook": {
|
||||
"command": "storybook dev",
|
||||
"continuous": true,
|
||||
"options": {
|
||||
"cwd": "my-react-lib",
|
||||
},
|
||||
},
|
||||
"static-storybook": {
|
||||
"continuous": true,
|
||||
"executor": "@nx/web:file-server",
|
||||
"options": {
|
||||
"buildTarget": "build-storybook",
|
||||
|
||||
@ -277,6 +277,7 @@ function serveTarget(
|
||||
) {
|
||||
if (frameworkIsAngular) {
|
||||
return {
|
||||
continuous: true,
|
||||
executor: '@storybook/angular:start-storybook',
|
||||
options: {
|
||||
configDir: `${dirname(configFilePath)}`,
|
||||
@ -286,6 +287,7 @@ function serveTarget(
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
continuous: true,
|
||||
command: `storybook dev`,
|
||||
options: { cwd: projectRoot },
|
||||
};
|
||||
@ -311,6 +313,7 @@ function serveStaticTarget(
|
||||
projectRoot: string
|
||||
) {
|
||||
const targetConfig: TargetConfiguration = {
|
||||
continuous: true,
|
||||
executor: '@nx/web:file-server',
|
||||
options: {
|
||||
buildTarget: `${options.buildStorybookTargetName}`,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user