@nx/rspack 22.2.0 → 22.2.2
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,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/rspack",
|
|
3
3
|
"description": "The Nx Plugin for Rspack contains executors and generators that support building applications using Rspack.",
|
|
4
|
-
"version": "22.2.
|
|
4
|
+
"version": "22.2.2",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -24,10 +24,10 @@
|
|
|
24
24
|
"generators": "./generators.json",
|
|
25
25
|
"executors": "./executors.json",
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@nx/devkit": "22.2.
|
|
28
|
-
"@nx/js": "22.2.
|
|
29
|
-
"@nx/module-federation": "22.2.
|
|
30
|
-
"@nx/web": "22.2.
|
|
27
|
+
"@nx/devkit": "22.2.2",
|
|
28
|
+
"@nx/js": "22.2.2",
|
|
29
|
+
"@nx/module-federation": "22.2.2",
|
|
30
|
+
"@nx/web": "22.2.2",
|
|
31
31
|
"@phenomnomnominal/tsquery": "~5.0.1",
|
|
32
32
|
"@rspack/core": "^1.5.2",
|
|
33
33
|
"@rspack/dev-server": "^1.1.4",
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
"webpack-node-externals": "^3.0.0"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"nx": "22.2.
|
|
61
|
-
"@nx/nest": "22.2.
|
|
60
|
+
"nx": "22.2.2",
|
|
61
|
+
"@nx/nest": "22.2.2"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
64
|
"@module-federation/enhanced": "^0.21.2",
|
|
@@ -228,9 +228,11 @@ function applyNxDependentConfig(options, config, { useNormalizedEntry } = {}) {
|
|
|
228
228
|
};
|
|
229
229
|
// When using TS solution setup, enable build mode to generate declaration files
|
|
230
230
|
// This prevents TS6305 errors when declaration files are expected but missing
|
|
231
|
-
// from module federation remote imports
|
|
231
|
+
// from module federation remote imports but disable emitting tsbuildinfo files
|
|
232
|
+
// so that tsc builds are not affected.
|
|
232
233
|
if (isUsingTsSolution) {
|
|
233
234
|
pluginConfig.typescript.build = true;
|
|
235
|
+
pluginConfig.typescript.mode = 'readonly';
|
|
234
236
|
}
|
|
235
237
|
plugins.push(new TsCheckerRspackPlugin(pluginConfig));
|
|
236
238
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apply-web-config.d.ts","sourceRoot":"","sources":["../../../../../../packages/rspack/src/plugins/utils/apply-web-config.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,aAAa,EAQlB,uBAAuB,EACxB,MAAM,cAAc,CAAC;AAUtB,OAAO,EAAE,kCAAkC,EAAE,MAAM,UAAU,CAAC;AAG9D,wBAAgB,cAAc,CAC5B,OAAO,EAAE,kCAAkC,EAC3C,MAAM,GAAE,OAAO,CAAC,uBAAuB,GAAG,aAAa,CAAM,EAC7D,EACE,kBAAkB,GACnB,GAAE;IAID,kBAAkB,CAAC,EAAE,OAAO,CAAC;CACzB,GACL,IAAI,
|
|
1
|
+
{"version":3,"file":"apply-web-config.d.ts","sourceRoot":"","sources":["../../../../../../packages/rspack/src/plugins/utils/apply-web-config.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,aAAa,EAQlB,uBAAuB,EACxB,MAAM,cAAc,CAAC;AAUtB,OAAO,EAAE,kCAAkC,EAAE,MAAM,UAAU,CAAC;AAG9D,wBAAgB,cAAc,CAC5B,OAAO,EAAE,kCAAkC,EAC3C,MAAM,GAAE,OAAO,CAAC,uBAAuB,GAAG,aAAa,CAAM,EAC7D,EACE,kBAAkB,GACnB,GAAE;IAID,kBAAkB,CAAC,EAAE,OAAO,CAAC;CACzB,GACL,IAAI,CAqXN"}
|
|
@@ -239,7 +239,10 @@ function applyWebConfig(options, config = {}, { useNormalizedEntry, } = {}) {
|
|
|
239
239
|
plugins.push(
|
|
240
240
|
// extract global css from js files into own css file
|
|
241
241
|
new core_1.CssExtractRspackPlugin({
|
|
242
|
-
filename:
|
|
242
|
+
filename: config.output?.cssFilename ??
|
|
243
|
+
(options.outputHashing
|
|
244
|
+
? `[name]${hashFormat.extract}.css`
|
|
245
|
+
: '[name].css'),
|
|
243
246
|
}));
|
|
244
247
|
}
|
|
245
248
|
config.output = {
|
|
@@ -345,11 +348,12 @@ function getClientEnvironment(mode) {
|
|
|
345
348
|
return env;
|
|
346
349
|
}, {});
|
|
347
350
|
// Stringify all values so we can feed into rspack DefinePlugin
|
|
348
|
-
const stringified = {
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
351
|
+
const stringified = Object.keys(raw).reduce((env, key) => {
|
|
352
|
+
env[`process.env.${key}`] = JSON.stringify(raw[key]);
|
|
353
|
+
return env;
|
|
354
|
+
},
|
|
355
|
+
// Provide a fallback for process.env itself to handle cases where code
|
|
356
|
+
// accesses process.env directly (e.g., in Cypress component testing)
|
|
357
|
+
{ 'process.env': '{}' });
|
|
354
358
|
return { stringified };
|
|
355
359
|
}
|
package/src/utils/with-web.js
CHANGED
|
@@ -33,11 +33,12 @@ function getClientEnvironment(mode) {
|
|
|
33
33
|
return env;
|
|
34
34
|
}, {});
|
|
35
35
|
// Stringify all values so we can feed into rspack DefinePlugin
|
|
36
|
-
const stringified = {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
const stringified = Object.keys(raw).reduce((env, key) => {
|
|
37
|
+
env[`process.env.${key}`] = JSON.stringify(raw[key]);
|
|
38
|
+
return env;
|
|
39
|
+
},
|
|
40
|
+
// Provide a fallback for process.env itself to handle cases where code
|
|
41
|
+
// accesses process.env directly (e.g., in Cypress component testing)
|
|
42
|
+
{ 'process.env': '{}' });
|
|
42
43
|
return { stringified };
|
|
43
44
|
}
|