@nx/react 20.5.0-canary.20250228-e8647df → 20.5.0-canary.20250304-8e6c007
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/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nx/react",
|
3
|
-
"version": "20.5.0-canary.
|
3
|
+
"version": "20.5.0-canary.20250304-8e6c007",
|
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.5.0-canary.
|
42
|
-
"@nx/js": "20.5.0-canary.
|
43
|
-
"@nx/eslint": "20.5.0-canary.
|
44
|
-
"@nx/web": "20.5.0-canary.
|
45
|
-
"@nx/module-federation": "20.5.0-canary.
|
41
|
+
"@nx/devkit": "20.5.0-canary.20250304-8e6c007",
|
42
|
+
"@nx/js": "20.5.0-canary.20250304-8e6c007",
|
43
|
+
"@nx/eslint": "20.5.0-canary.20250304-8e6c007",
|
44
|
+
"@nx/web": "20.5.0-canary.20250304-8e6c007",
|
45
|
+
"@nx/module-federation": "20.5.0-canary.20250304-8e6c007",
|
46
46
|
"express": "^4.21.2",
|
47
47
|
"http-proxy-middleware": "^3.0.3",
|
48
48
|
"semver": "^7.6.3"
|
@@ -1,4 +1,6 @@
|
|
1
1
|
import { Tree } from 'nx/src/generators/tree';
|
2
2
|
import { GeneratorCallback } from '@nx/devkit';
|
3
3
|
import { NormalizedSchema } from '../schema';
|
4
|
-
export declare function addRollupBuildTarget(host: Tree, options: NormalizedSchema
|
4
|
+
export declare function addRollupBuildTarget(host: Tree, options: NormalizedSchema & {
|
5
|
+
format?: Array<'esm' | 'cjs'>;
|
6
|
+
}, external?: Set<String>): Promise<GeneratorCallback>;
|
@@ -4,7 +4,7 @@ exports.addRollupBuildTarget = addRollupBuildTarget;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
5
5
|
const maybe_js_1 = require("../../../utils/maybe-js");
|
6
6
|
const versions_1 = require("../../../utils/versions");
|
7
|
-
async function addRollupBuildTarget(host, options) {
|
7
|
+
async function addRollupBuildTarget(host, options, external = new Set(['react', 'react-dom'])) {
|
8
8
|
const tasks = [];
|
9
9
|
const { configurationGenerator } = (0, devkit_1.ensurePackage)('@nx/rollup', versions_1.nxVersion);
|
10
10
|
tasks.push(await configurationGenerator(host, {
|
@@ -19,12 +19,11 @@ async function addRollupBuildTarget(host, options) {
|
|
19
19
|
'@svgr/rollup': versions_1.svgrRollupVersion,
|
20
20
|
}));
|
21
21
|
}
|
22
|
-
const external = ['react', 'react-dom'];
|
23
22
|
if (options.style === '@emotion/styled') {
|
24
|
-
external.
|
23
|
+
external.add('@emotion/react/jsx-runtime');
|
25
24
|
}
|
26
25
|
else {
|
27
|
-
external.
|
26
|
+
external.add('react/jsx-runtime');
|
28
27
|
}
|
29
28
|
const nxJson = (0, devkit_1.readNxJson)(host);
|
30
29
|
const hasRollupPlugin = !!nxJson.plugins?.some((p) => typeof p === 'string'
|
@@ -44,8 +43,8 @@ module.exports = withNx(
|
|
44
43
|
: (0, devkit_1.joinPathFragments)((0, devkit_1.offsetFromRoot)(options.projectRoot), 'dist', options.projectRoot)}',
|
45
44
|
tsConfig: './tsconfig.lib.json',
|
46
45
|
compiler: '${options.compiler ?? 'babel'}',
|
47
|
-
external: ${JSON.stringify(external)},
|
48
|
-
format: ['esm'],
|
46
|
+
external: ${JSON.stringify(Array.from(external))},
|
47
|
+
format: ${JSON.stringify(options.format ?? ['esm'])},
|
49
48
|
assets:[{ input: '.', output: '.', glob: 'README.md'}],
|
50
49
|
}, {
|
51
50
|
// Provide additional rollup configuration here. See: https://rollupjs.org/configuration-options
|
@@ -74,7 +73,7 @@ module.exports = withNx(
|
|
74
73
|
tsConfig: `${options.projectRoot}/tsconfig.lib.json`,
|
75
74
|
project: `${options.projectRoot}/package.json`,
|
76
75
|
entryFile: (0, maybe_js_1.maybeJs)(options, `${options.projectRoot}/src/index.ts`),
|
77
|
-
external,
|
76
|
+
external: Array.from(external),
|
78
77
|
rollupConfig: `@nx/react/plugins/bundle-rollup`,
|
79
78
|
compiler: options.compiler ?? 'babel',
|
80
79
|
assets: [
|