@nx/react 17.2.5 → 17.2.6
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/README.md
CHANGED
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
<p style="text-align: center;">
|
|
2
|
-
<picture>
|
|
3
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-dark.svg">
|
|
4
|
-
<img alt="Nx - Smart Monorepos · Fast CI" src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-light.svg" width="100%">
|
|
5
|
-
</picture>
|
|
6
|
-
</p>
|
|
1
|
+
<p style="text-align: center;"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx.png" width="600" alt="Nx - Smart, Fast and Extensible Build System"></p>
|
|
7
2
|
|
|
8
3
|
<div style="text-align: center;">
|
|
9
4
|
|
|
@@ -20,9 +15,9 @@
|
|
|
20
15
|
|
|
21
16
|
<hr>
|
|
22
17
|
|
|
23
|
-
# Nx: Smart
|
|
18
|
+
# Nx: Smart, Fast and Extensible Build System
|
|
24
19
|
|
|
25
|
-
Nx is a build system with
|
|
20
|
+
Nx is a next generation build system with first class monorepo support and powerful integrations.
|
|
26
21
|
|
|
27
22
|
This package is a [React plugin for Nx](https://nx.dev/packages/react).
|
|
28
23
|
|
|
@@ -64,5 +59,5 @@ npx nx@latest init
|
|
|
64
59
|
- [Blog Posts About Nx](https://blog.nrwl.io/nx/home)
|
|
65
60
|
|
|
66
61
|
<p style="text-align: center;"><a href="https://nx.dev/#learning-materials" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-courses-and-videos.svg"
|
|
67
|
-
width="100%" alt="Nx - Smart
|
|
62
|
+
width="100%" alt="Nx - Smart, Fast and Extensible Build System"></a></p>
|
|
68
63
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/react",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "17.2.6",
|
|
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, 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": {
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
"file-loader": "^6.2.0",
|
|
38
38
|
"minimatch": "3.0.5",
|
|
39
39
|
"tslib": "^2.3.0",
|
|
40
|
-
"@nx/devkit": "
|
|
41
|
-
"@nx/js": "
|
|
42
|
-
"@nx/eslint": "
|
|
43
|
-
"@nx/web": "
|
|
44
|
-
"@nrwl/react": "
|
|
40
|
+
"@nx/devkit": "17.2.6",
|
|
41
|
+
"@nx/js": "17.2.6",
|
|
42
|
+
"@nx/eslint": "17.2.6",
|
|
43
|
+
"@nx/web": "17.2.6",
|
|
44
|
+
"@nrwl/react": "17.2.6"
|
|
45
45
|
},
|
|
46
46
|
"publishConfig": {
|
|
47
47
|
"access": "public"
|
|
@@ -3,18 +3,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.withModuleFederation = void 0;
|
|
4
4
|
const utils_1 = require("./utils");
|
|
5
5
|
const ModuleFederationPlugin = require("webpack/lib/container/ModuleFederationPlugin");
|
|
6
|
-
const isVarOrWindow = (libType) => libType === 'var' || libType === 'window';
|
|
7
6
|
/**
|
|
8
7
|
* @param {ModuleFederationConfig} options
|
|
9
8
|
* @return {Promise<AsyncNxComposableWebpackPlugin>}
|
|
10
9
|
*/
|
|
11
10
|
async function withModuleFederation(options) {
|
|
12
11
|
const { sharedDependencies, sharedLibraries, mappedRemotes } = await (0, utils_1.getModuleFederationConfig)(options);
|
|
13
|
-
const isGlobal = isVarOrWindow(options.library?.type);
|
|
14
12
|
return (config, ctx) => {
|
|
15
13
|
config.output.uniqueName = options.name;
|
|
16
14
|
config.output.publicPath = 'auto';
|
|
17
|
-
if (
|
|
15
|
+
if (options.library?.type === 'var') {
|
|
18
16
|
config.output.scriptType = 'text/javascript';
|
|
19
17
|
}
|
|
20
18
|
config.optimization = {
|
|
@@ -22,7 +20,7 @@ async function withModuleFederation(options) {
|
|
|
22
20
|
};
|
|
23
21
|
config.experiments = {
|
|
24
22
|
...config.experiments,
|
|
25
|
-
outputModule: !
|
|
23
|
+
outputModule: !(options.library?.type === 'var'),
|
|
26
24
|
};
|
|
27
25
|
config.plugins.push(new ModuleFederationPlugin({
|
|
28
26
|
name: options.name,
|
|
@@ -39,7 +37,7 @@ async function withModuleFederation(options) {
|
|
|
39
37
|
* { appX: 'appX@http://localhost:3001/remoteEntry.js' }
|
|
40
38
|
* { appY: 'appY@http://localhost:3002/remoteEntry.js' }
|
|
41
39
|
*/
|
|
42
|
-
...(
|
|
40
|
+
...(options.library?.type === 'var' ? { remoteType: 'script' } : {}),
|
|
43
41
|
}), sharedLibraries.getReplacementPlugin());
|
|
44
42
|
return config;
|
|
45
43
|
};
|