@nx/rspack 20.0.5 → 20.0.7
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": "20.0.
|
|
4
|
+
"version": "20.0.7",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -24,13 +24,13 @@
|
|
|
24
24
|
"generators": "./generators.json",
|
|
25
25
|
"executors": "./executors.json",
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@nx/js": "20.0.
|
|
28
|
-
"@nx/devkit": "20.0.
|
|
29
|
-
"@nx/web": "20.0.
|
|
27
|
+
"@nx/js": "20.0.7",
|
|
28
|
+
"@nx/devkit": "20.0.7",
|
|
29
|
+
"@nx/web": "20.0.7",
|
|
30
30
|
"@phenomnomnominal/tsquery": "~5.0.1",
|
|
31
31
|
"enquirer": "~2.3.6",
|
|
32
32
|
"express": "^4.19.2",
|
|
33
|
-
"http-proxy-middleware": "^3.0.
|
|
33
|
+
"http-proxy-middleware": "^3.0.3",
|
|
34
34
|
"less-loader": "11.1.0",
|
|
35
35
|
"license-webpack-plugin": "^4.0.2",
|
|
36
36
|
"sass-loader": "^12.2.0",
|
|
@@ -212,8 +212,28 @@ function createConfig(options, stylePreprocessorOptions) {
|
|
|
212
212
|
else if (options.framework === 'nest') {
|
|
213
213
|
return `
|
|
214
214
|
const { composePlugins, withNx } = require('@nx/rspack');
|
|
215
|
+
const rspack = require('@rspack/core');
|
|
215
216
|
|
|
216
217
|
module.exports = composePlugins(withNx(), (config) => {
|
|
218
|
+
config.optimization = {
|
|
219
|
+
minimizer: [
|
|
220
|
+
new rspack.SwcJsMinimizerRspackPlugin({
|
|
221
|
+
minimizerOptions: {
|
|
222
|
+
// We need to disable mangling and compression for class names and function names for Nest.js to work properly
|
|
223
|
+
// The execution context class returns a reference to the class/handler function, which is for example used for applying metadata using decorators
|
|
224
|
+
// https://docs.nestjs.com/fundamentals/execution-context#executioncontext-class
|
|
225
|
+
compress: {
|
|
226
|
+
keep_classnames: true,
|
|
227
|
+
keep_fnames: true,
|
|
228
|
+
},
|
|
229
|
+
mangle: {
|
|
230
|
+
keep_classnames: true,
|
|
231
|
+
keep_fnames: true,
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
}),
|
|
235
|
+
],
|
|
236
|
+
};
|
|
217
237
|
return config;
|
|
218
238
|
});
|
|
219
239
|
`;
|
package/src/utils/with-web.js
CHANGED
|
@@ -96,9 +96,10 @@ function withWeb(opts = {}) {
|
|
|
96
96
|
template: options.indexHtml
|
|
97
97
|
? path.join(context.root, options.indexHtml)
|
|
98
98
|
: path.join(projectRoot, 'src/index.html'),
|
|
99
|
+
...(options.baseHref ? { base: { href: options.baseHref } } : {}),
|
|
99
100
|
}),
|
|
100
101
|
new core_1.rspack.EnvironmentPlugin({
|
|
101
|
-
NODE_ENV: 'development',
|
|
102
|
+
NODE_ENV: isProd ? 'production' : 'development',
|
|
102
103
|
}),
|
|
103
104
|
],
|
|
104
105
|
};
|