@nx/react 20.2.0-canary.20241204-75b2080 → 20.2.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/generators.json CHANGED
@@ -64,13 +64,15 @@
64
64
  "factory": "./src/generators/host/host",
65
65
  "schema": "./src/generators/host/schema.json",
66
66
  "x-type": "application",
67
- "description": "Generate a host react application"
67
+ "description": "Generate a host react application",
68
+ "aliases": ["consumer"]
68
69
  },
69
70
  "remote": {
70
71
  "factory": "./src/generators/remote/remote",
71
72
  "schema": "./src/generators/remote/schema.json",
72
73
  "x-type": "application",
73
- "description": "Generate a remote react application"
74
+ "description": "Generate a remote react application",
75
+ "aliases": ["producer"]
74
76
  },
75
77
  "cypress-component-configuration": {
76
78
  "factory": "./src/generators/cypress-component-configuration/cypress-component-configuration#cypressComponentConfigGenerator",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/react",
3
- "version": "20.2.0-canary.20241204-75b2080",
3
+ "version": "20.2.0-rc.0",
4
4
  "private": false,
5
5
  "description": "The React plugin for Nx contains executors and generators for managing React applications and libraries within an Nx workspace. It provides:\n\n\n- Integration with libraries such as Jest, Vitest, Playwright, Cypress, and Storybook.\n\n- Generators for applications, libraries, components, hooks, and more.\n\n- Library build support for publishing packages to npm or other registries.\n\n- Utilities for automatic workspace refactoring.",
6
6
  "repository": {
@@ -38,11 +38,11 @@
38
38
  "minimatch": "9.0.3",
39
39
  "picocolors": "^1.1.0",
40
40
  "tslib": "^2.3.0",
41
- "@nx/devkit": "20.2.0-canary.20241204-75b2080",
42
- "@nx/js": "20.2.0-canary.20241204-75b2080",
43
- "@nx/eslint": "20.2.0-canary.20241204-75b2080",
44
- "@nx/web": "20.2.0-canary.20241204-75b2080",
45
- "@nx/module-federation": "20.2.0-canary.20241204-75b2080",
41
+ "@nx/devkit": "20.2.0-rc.0",
42
+ "@nx/js": "20.2.0-rc.0",
43
+ "@nx/eslint": "20.2.0-rc.0",
44
+ "@nx/web": "20.2.0-rc.0",
45
+ "@nx/module-federation": "20.2.0-rc.0",
46
46
  "express": "^4.19.2",
47
47
  "http-proxy-middleware": "^3.0.3"
48
48
  },
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- // TODO(v22): Remove this in Nx 22 and migrate to explicit rollup.config.js files.
3
+ // TODO(v22): Remove this in Nx 22 and migrate to explicit rollup.config.cjs files.
4
4
  /**
5
- * @deprecated Use `withNx` function from `@nx/rollup/with-nx` in your rollup.config.js file instead. Use `nx g @nx/rollup:convert-to-inferred` to generate the rollup.config.js file if it does not exist.
5
+ * @deprecated Use `withNx` function from `@nx/rollup/with-nx` in your rollup.config.cjs file instead. Use `nx g @nx/rollup:convert-to-inferred` to generate the rollup.config.cjs file if it does not exist.
6
6
  */
7
7
  function getRollupOptions(options) {
8
8
  const extraGlobals = {
@@ -28,16 +28,18 @@
28
28
  }
29
29
  ]
30
30
  },
31
- "description": "List of remote applications to run in development mode (i.e. using serve target).",
32
- "x-priority": "important"
31
+ "description": "List of Producer (remote) applications to run in development mode (i.e. using serve target).",
32
+ "x-priority": "important",
33
+ "alias": "devProducers"
33
34
  },
34
35
  "skipRemotes": {
35
36
  "type": "array",
36
37
  "items": {
37
38
  "type": "string"
38
39
  },
39
- "description": "List of remote applications to not automatically serve, either statically or in development mode. This will not remove the remotes from the `module-federation.config` file, and therefore the application may still try to fetch these remotes.\nThis option is useful if you have other means for serving the `remote` application(s).\n**NOTE:** Remotes that are not in the workspace will be skipped automatically.",
40
- "x-priority": "important"
40
+ "description": "List of Producer (remote) applications to not automatically serve, either statically or in development mode. This will not remove the Producers (remotes) from the `module-federation.config` file, and therefore the application may still try to fetch these Producers (remotes).\nThis option is useful if you have other means for serving the Producer (remote) application(s).\n**NOTE:** Producers (remotes) that are not in the workspace will be skipped automatically.",
41
+ "x-priority": "important",
42
+ "alias": "skipProducers"
41
43
  },
42
44
  "buildTarget": {
43
45
  "type": "string",
@@ -111,25 +113,27 @@
111
113
  },
112
114
  "static": {
113
115
  "type": "boolean",
114
- "description": "Whether to use a static file server instead of the webpack-dev-server. This should be used for remote applications that are also host applications."
116
+ "description": "Whether to use a static file server instead of the webpack-dev-server. This should be used for Producer (remote) applications that are also Consumer (host) applications."
115
117
  },
116
118
  "isInitialHost": {
117
119
  "type": "boolean",
118
- "description": "Whether the host that is running this executor is the first in the project tree to do so.",
120
+ "description": "Whether the Consumer (host) that is running this executor is the first in the project tree to do so.",
119
121
  "default": true,
120
- "x-priority": "internal"
122
+ "x-priority": "internal",
123
+ "alias": "isInitialConsumer"
121
124
  },
122
125
  "parallel": {
123
126
  "type": "number",
124
- "description": "Max number of parallel processes for building static remotes"
127
+ "description": "Max number of parallel processes for building static Producers (remotes)"
125
128
  },
126
129
  "staticRemotesPort": {
127
130
  "type": "number",
128
- "description": "The port at which to serve the file-server for the static remotes."
131
+ "description": "The port at which to serve the file-server for the static Producers (remotes).",
132
+ "alias": "staticProducersPort"
129
133
  },
130
134
  "pathToManifestFile": {
131
135
  "type": "string",
132
- "description": "Path to a Module Federation manifest file (e.g. `my/path/to/module-federation.manifest.json`) containing the dynamic remote applications relative to the workspace root."
136
+ "description": "Path to a Module Federation manifest file (e.g. `my/path/to/module-federation.manifest.json`) containing the dynamic Producer (remote) applications relative to the workspace root."
133
137
  }
134
138
  },
135
139
  "examplesFile": "../../../docs/module-federation-dev-server-examples.md"
@@ -2,7 +2,7 @@
2
2
  "version": 2,
3
3
  "outputCapture": "direct-nodejs",
4
4
  "title": "Module Federation SSR Dev Server",
5
- "description": "Serve a SSR host application along with its known remotes.",
5
+ "description": "Serve a SSR Consumer (host) application along with its known Producers (remotes).",
6
6
  "cli": "nx",
7
7
  "type": "object",
8
8
  "properties": {
@@ -27,16 +27,18 @@
27
27
  "items": {
28
28
  "type": "string"
29
29
  },
30
- "description": "List of remote applications to run in development mode (i.e. using serve target).",
31
- "x-priority": "important"
30
+ "description": "List of Producer (remote) applications to run in development mode (i.e. using serve target).",
31
+ "x-priority": "important",
32
+ "alias": "devProducers"
32
33
  },
33
34
  "skipRemotes": {
34
35
  "type": "array",
35
36
  "items": {
36
37
  "type": "string"
37
38
  },
38
- "description": "List of remote applications to not automatically serve, either statically or in development mode.",
39
- "x-priority": "important"
39
+ "description": "List of Producer (remote) applications to not automatically serve, either statically or in development mode.",
40
+ "x-priority": "important",
41
+ "alias": "skipProducers"
40
42
  },
41
43
  "host": {
42
44
  "type": "string",
@@ -45,11 +47,12 @@
45
47
  },
46
48
  "staticRemotesPort": {
47
49
  "type": "number",
48
- "description": "The port at which to serve the file-server for the static remotes."
50
+ "description": "The port at which to serve the file-server for the static Producers (remotes).",
51
+ "alias": "staticProducersPort"
49
52
  },
50
53
  "pathToManifestFile": {
51
54
  "type": "string",
52
- "description": "Path to a Module Federation manifest file (e.g. `my/path/to/module-federation.manifest.json`) containing the dynamic remote applications relative to the workspace root."
55
+ "description": "Path to a Module Federation manifest file (e.g. `my/path/to/module-federation.manifest.json`) containing the dynamic Producer (remote) applications relative to the workspace root."
53
56
  },
54
57
  "ssl": {
55
58
  "type": "boolean",
@@ -66,9 +69,10 @@
66
69
  },
67
70
  "isInitialHost": {
68
71
  "type": "boolean",
69
- "description": "Whether the host that is running this executor is the first in the project tree to do so.",
72
+ "description": "Whether the Consumer (host) that is running this executor is the first in the project tree to do so.",
70
73
  "default": true,
71
- "x-priority": "internal"
74
+ "x-priority": "internal",
75
+ "alias": "isInitialConsumer"
72
76
  }
73
77
  },
74
78
  "required": ["browserTarget", "serverTarget"]
@@ -58,7 +58,7 @@ async function buildHost(nxBin, buildTarget, context) {
58
58
  }
59
59
  if (stdoutString.includes('Successfully ran target build')) {
60
60
  staticProcess.stdout.removeAllListeners('data');
61
- devkit_1.logger.info(`NX Built host`);
61
+ devkit_1.logger.info(`NX Built Consumer (host)`);
62
62
  res();
63
63
  }
64
64
  });
@@ -67,7 +67,7 @@ async function buildHost(nxBin, buildTarget, context) {
67
67
  staticProcess.stdout.removeAllListeners('data');
68
68
  staticProcess.stderr.removeAllListeners('data');
69
69
  if (code !== 0) {
70
- rej(`Host failed to build. See above for details.`);
70
+ rej(`Consumer (host) failed to build. See above for details.`);
71
71
  }
72
72
  else {
73
73
  res();
@@ -132,8 +132,8 @@ function startProxies(staticRemotesConfig, hostServeOptions, mappedLocationOfHos
132
132
  process.on('SIGTERM', () => proxyServer.close());
133
133
  process.on('exit', () => proxyServer.close());
134
134
  }
135
- devkit_1.logger.info(`NX Static remotes proxies started successfully`);
136
- devkit_1.logger.info(`NX Starting static host proxy...`);
135
+ devkit_1.logger.info(`NX Static Producers (remotes) proxies started successfully`);
136
+ devkit_1.logger.info(`NX Starting static Consumer (host) proxy...`);
137
137
  const expressProxy = express();
138
138
  expressProxy.use(createProxyMiddleware({
139
139
  target: mappedLocationOfHost,
@@ -155,7 +155,7 @@ function startProxies(staticRemotesConfig, hostServeOptions, mappedLocationOfHos
155
155
  .listen(hostServeOptions.port);
156
156
  process.on('SIGTERM', () => proxyServer.close());
157
157
  process.on('exit', () => proxyServer.close());
158
- devkit_1.logger.info('NX Static host proxy started successfully');
158
+ devkit_1.logger.info('NX Static Consumer (host) proxy started successfully');
159
159
  }
160
160
  async function* moduleFederationStaticServer(schema, context) {
161
161
  // Force Node to resolve to look for the nx binary that is inside node_modules
@@ -2,7 +2,7 @@
2
2
  "version": 2,
3
3
  "outputCapture": "direct-nodejs",
4
4
  "title": "Module Federation Static Dev Server",
5
- "description": "Serve a host application statically along with it's remotes.",
5
+ "description": "Serve a Consumer (host) application statically along with its Producers (remotes).",
6
6
  "cli": "nx",
7
7
  "type": "object",
8
8
  "properties": {
@@ -13,8 +13,7 @@ function createComponentStoriesFile(host, { project, componentPath, interactionT
13
13
  tsModule = (0, ensure_typescript_1.ensureTypescript)();
14
14
  }
15
15
  const proj = (0, devkit_1.getProjects)(host).get(project);
16
- const sourceRoot = proj.sourceRoot;
17
- const componentFilePath = (0, devkit_1.joinPathFragments)(sourceRoot, componentPath);
16
+ const componentFilePath = (0, devkit_1.joinPathFragments)(proj.sourceRoot ?? proj.root, componentPath);
18
17
  const componentDirectory = componentFilePath.replace(componentFilePath.slice(componentFilePath.lastIndexOf('/')), '');
19
18
  const isPlainJs = componentFilePath.endsWith('.jsx') || componentFilePath.endsWith('.js');
20
19
  const componentFileName = componentFilePath
@@ -3,11 +3,15 @@
3
3
  "cli": "nx",
4
4
  "$id": "NxReactFederateModule",
5
5
  "title": "Federate Module",
6
- "description": "Create a federated module, which can be loaded by a remote host.",
6
+ "description": "Create a federated module, which can be loaded by a Consumer (host) via a Producer (remote).",
7
7
  "examples": [
8
8
  {
9
- "command": "nx g federate-module MyModule --path=./src/component/my-cmp.ts --remote=my-remote-app --remoteDirectory=apps/my-remote-app",
10
- "description": "Create a federated module from my-remote-app, that exposes my-cmp from ./src/component/my-cmp.ts as MyModule."
9
+ "command": "nx g federate-module MyModule --path=./src/component/my-cmp.ts --remote=myRemote --remoteDirectory=apps/myRemote",
10
+ "description": "Create a federated module from myRemote, that exposes my-cmp from ./src/component/my-cmp.ts as MyModule."
11
+ },
12
+ {
13
+ "command": "nx g federate-module MyModule --path=./src/component/my-cmp.ts --producer=myProducer --producerDirectory=apps/myProducer",
14
+ "description": "Create a federated module from myProducer, that exposes my-cmp from ./src/component/my-cmp.ts as MyModule."
11
15
  }
12
16
  ],
13
17
  "type": "object",
@@ -30,12 +34,14 @@
30
34
  },
31
35
  "remote": {
32
36
  "type": "string",
33
- "description": "The name of the remote.",
34
- "x-prompt": "What is/should the remote be named?"
37
+ "description": "The name of the Producer (remote).",
38
+ "x-prompt": "What is/should the Producer (remote) be named?",
39
+ "alias": "producer"
35
40
  },
36
41
  "remoteDirectory": {
37
- "description": "The directory of the new remote application if one needs to be created.",
38
- "type": "string"
42
+ "description": "The directory of the new Producer (remote) application if one needs to be created.",
43
+ "type": "string",
44
+ "alias": "producerDirectory"
39
45
  },
40
46
  "style": {
41
47
  "description": "The file extension to be used for style files.",
@@ -70,7 +76,7 @@
70
76
  },
71
77
  "host": {
72
78
  "type": "string",
73
- "description": "The host / shell application for this remote."
79
+ "description": "The Consumer (host) application for this Producer (remote)."
74
80
  },
75
81
  "bundler": {
76
82
  "description": "The bundler to use.",
@@ -2,8 +2,8 @@
2
2
  "$schema": "https://json-schema.org/schema",
3
3
  "$id": "GeneratorReactHost",
4
4
  "cli": "nx",
5
- "title": "Generate Module Federation Setup for React Host App",
6
- "description": "Create Module Federation configuration files for given React Host Application.",
5
+ "title": "Generate Module Federation Setup for React Consumer (Host) App",
6
+ "description": "Create Module Federation configuration files for given React Consumer (Host) Application.",
7
7
  "type": "object",
8
8
  "properties": {
9
9
  "directory": {
@@ -18,7 +18,7 @@
18
18
  },
19
19
  "name": {
20
20
  "type": "string",
21
- "description": "The name of the host application to generate the Module Federation configuration",
21
+ "description": "The name of the Consumer (host) application to generate the Module Federation configuration",
22
22
  "pattern": "^[a-zA-Z][^:]*$",
23
23
  "x-priority": "important"
24
24
  },
@@ -74,7 +74,7 @@
74
74
  },
75
75
  "dynamic": {
76
76
  "type": "boolean",
77
- "description": "Should the host application use dynamic federation?",
77
+ "description": "Should the Consumer (host) application use dynamic federation?",
78
78
  "default": false
79
79
  },
80
80
  "skipFormat": {
@@ -141,18 +141,19 @@
141
141
  },
142
142
  "remotes": {
143
143
  "type": "array",
144
- "description": "A list of remote application names that the host application should consume.",
144
+ "description": "A list of Producer (remote) application names that the Consumer (host) application should consume.",
145
145
  "default": [],
146
- "x-priority": "important"
146
+ "x-priority": "important",
147
+ "alias": "producers"
147
148
  },
148
149
  "devServerPort": {
149
150
  "type": "number",
150
- "description": "The port for the dev server of the remote app.",
151
+ "description": "The port for the dev server of the Producer (remote) app.",
151
152
  "default": 4200,
152
153
  "x-priority": "important"
153
154
  },
154
155
  "ssr": {
155
- "description": "Whether to configure SSR for the host application",
156
+ "description": "Whether to configure SSR for the Consumer (host) application",
156
157
  "type": "boolean",
157
158
  "default": false
158
159
  },
@@ -32,33 +32,36 @@ async function addRollupBuildTarget(host, options) {
32
32
  : p.plugin === '@nx/rollup/plugin');
33
33
  if (hasRollupPlugin) {
34
34
  // New behavior, using rollup config file and inferred target.
35
- host.write((0, devkit_1.joinPathFragments)(options.projectRoot, 'rollup.config.js'), (0, devkit_1.stripIndents) `
36
- const { withNx } = require('@nx/rollup/with-nx');
37
- const url = require('@rollup/plugin-url');
38
- const svg = require('@svgr/rollup');
39
-
40
- module.exports = withNx({
41
- main: '${(0, maybe_js_1.maybeJs)(options, './src/index.ts')}',
42
- outputPath: '${(0, devkit_1.joinPathFragments)((0, devkit_1.offsetFromRoot)(options.projectRoot), 'dist', options.projectRoot)}',
43
- tsConfig: './tsconfig.lib.json',
44
- compiler: '${options.compiler ?? 'babel'}',
45
- external: ${JSON.stringify(external)},
46
- format: ['esm'],
47
- assets:[{ input: '.', output: '.', glob: 'README.md'}],
48
- }, {
49
- // Provide additional rollup configuration here. See: https://rollupjs.org/configuration-options
50
- plugins: [
51
- svg({
52
- svgo: false,
53
- titleProp: true,
54
- ref: true,
55
- }),
56
- url({
57
- limit: 10000, // 10kB
58
- }),
59
- ],
60
- });
61
- `);
35
+ host.write((0, devkit_1.joinPathFragments)(options.projectRoot, 'rollup.config.cjs'), `const { withNx } = require('@nx/rollup/with-nx');
36
+ const url = require('@rollup/plugin-url');
37
+ const svg = require('@svgr/rollup');
38
+
39
+ module.exports = withNx(
40
+ {
41
+ main: '${(0, maybe_js_1.maybeJs)(options, './src/index.ts')}',
42
+ outputPath: '${options.isUsingTsSolutionConfig
43
+ ? './dist'
44
+ : (0, devkit_1.joinPathFragments)((0, devkit_1.offsetFromRoot)(options.projectRoot), 'dist', options.projectRoot)}',
45
+ tsConfig: './tsconfig.lib.json',
46
+ compiler: '${options.compiler ?? 'babel'}',
47
+ external: ${JSON.stringify(external)},
48
+ format: ['esm'],
49
+ assets:[{ input: '.', output: '.', glob: 'README.md'}],
50
+ }, {
51
+ // Provide additional rollup configuration here. See: https://rollupjs.org/configuration-options
52
+ plugins: [
53
+ svg({
54
+ svgo: false,
55
+ titleProp: true,
56
+ ref: true,
57
+ }),
58
+ url({
59
+ limit: 10000, // 10kB
60
+ }),
61
+ ],
62
+ }
63
+ );
64
+ `);
62
65
  }
63
66
  else {
64
67
  // Legacy behavior, there is a target in project.json using rollup executor.
@@ -24,7 +24,7 @@ function updateHostWithRemote(host, hostName, remoteName) {
24
24
  }
25
25
  else {
26
26
  // TODO(jack): Point to the nx.dev guide when ready.
27
- devkit_1.logger.warn(`Could not find configuration at ${moduleFederationConfigPath}. Did you generate this project with "@nx/react:host"?`);
27
+ devkit_1.logger.warn(`Could not find configuration at ${moduleFederationConfigPath}. Did you generate this project with "@nx/react:host" or "@nx/react:consumer"?`);
28
28
  }
29
29
  if (host.exists(appComponentPath)) {
30
30
  let sourceCode = host.read(appComponentPath).toString();
@@ -32,7 +32,7 @@ function updateHostWithRemote(host, hostName, remoteName) {
32
32
  host.write(appComponentPath, (0, devkit_1.applyChangesToString)(sourceCode, (0, ast_utils_1.addRemoteRoute)(source, (0, devkit_1.names)(remoteName))));
33
33
  }
34
34
  else {
35
- devkit_1.logger.warn(`Could not find app component at ${appComponentPath}. Did you generate this project with "@nx/react:host"?`);
35
+ devkit_1.logger.warn(`Could not find app component at ${appComponentPath}. Did you generate this project with "@nx/react:host" or "@nx/react:consumer"?`);
36
36
  }
37
37
  }
38
38
  function findAppComponentPath(host, sourceRoot) {
@@ -2,8 +2,8 @@
2
2
  "$schema": "https://json-schema.org/schema",
3
3
  "$id": "GeneratorReactRemote",
4
4
  "cli": "nx",
5
- "title": "Generate Module Federation Setup for React Remote App",
6
- "description": "Create Module Federation configuration files for given React Remote Application.",
5
+ "title": "Generate Module Federation Setup for React Producer (Remote) App",
6
+ "description": "Create Module Federation configuration files for given React Producer (Remote) Application.",
7
7
  "type": "object",
8
8
  "properties": {
9
9
  "directory": {
@@ -18,13 +18,13 @@
18
18
  },
19
19
  "name": {
20
20
  "type": "string",
21
- "description": "The name of the remote application to generate the Module Federation configuration",
21
+ "description": "The name of the Producer (remote) application to generate the Module Federation configuration",
22
22
  "pattern": "^[a-zA-Z_$][a-zA-Z_$0-9]*$",
23
23
  "x-priority": "important"
24
24
  },
25
25
  "dynamic": {
26
26
  "type": "boolean",
27
- "description": "Should the host application use dynamic federation?",
27
+ "description": "Should the Consumer (host) application use dynamic federation?",
28
28
  "default": false,
29
29
  "x-priority": "internal"
30
30
  },
@@ -147,16 +147,17 @@
147
147
  },
148
148
  "host": {
149
149
  "type": "string",
150
- "description": "The host / shell application for this remote.",
151
- "x-priority": "important"
150
+ "description": "The Consumer (host) application for this Producer (remote).",
151
+ "x-priority": "important",
152
+ "alias": "consumer"
152
153
  },
153
154
  "devServerPort": {
154
155
  "type": "number",
155
- "description": "The port for the dev server of the remote app.",
156
+ "description": "The port for the dev server of the Producer (remote) app.",
156
157
  "x-priority": "important"
157
158
  },
158
159
  "ssr": {
159
- "description": "Whether to configure SSR for the host application",
160
+ "description": "Whether to configure SSR for the Consumer (host) application",
160
161
  "type": "boolean",
161
162
  "default": false
162
163
  },
@@ -29,7 +29,10 @@ async function projectRootPath(tree, config) {
29
29
  // libs/test-lib/src/lib
30
30
  projectDir = 'lib';
31
31
  }
32
- return (0, devkit_1.joinPathFragments)(config.sourceRoot, projectDir);
32
+ else {
33
+ projectDir = '.';
34
+ }
35
+ return (0, devkit_1.joinPathFragments)(config.sourceRoot ?? config.root, projectDir);
33
36
  }
34
37
  function containsComponentDeclaration(tree, componentPath) {
35
38
  if (!tsModule) {
@@ -70,7 +73,7 @@ async function createAllStories(tree, projectName, interactionTests, js, project
70
73
  }
71
74
  });
72
75
  await Promise.all(componentPaths.map(async (componentPath) => {
73
- const relativeCmpDir = componentPath.replace((0, path_1.join)(sourceRoot, '/'), '');
76
+ const relativeCmpDir = componentPath.replace((0, path_1.join)(sourceRoot ?? root, '/'), '');
74
77
  if (!containsComponentDeclaration(tree, componentPath)) {
75
78
  return;
76
79
  }
@@ -32,8 +32,8 @@ async function storybookConfigurationGeneratorInternal(host, schema) {
32
32
  let uiFramework = '@storybook/react-vite';
33
33
  const projectConfig = (0, devkit_1.readProjectConfiguration)(host, schema.project);
34
34
  if (findWebpackConfig(host, projectConfig.root) ||
35
- projectConfig.targets['build']?.executor === '@nx/rollup:rollup' ||
36
- projectConfig.targets['build']?.executor === '@nx/expo:build') {
35
+ projectConfig.targets?.['build']?.executor === '@nx/rollup:rollup' ||
36
+ projectConfig.targets?.['build']?.executor === '@nx/expo:build') {
37
37
  uiFramework = '@storybook/react-webpack5';
38
38
  }
39
39
  if (uiFramework === '@storybook/react-vite') {