@nx/rspack 20.5.0-beta.4 → 20.5.0-beta.5
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/migrations.json +9 -1
- package/package.json +10 -9
- package/src/executors/rspack/lib/normalize-options.js +1 -0
- package/src/executors/rspack/schema.d.ts +6 -1
- package/src/executors/rspack/schema.json +14 -0
- package/src/generators/init/init.js +4 -0
- package/src/plugins/utils/apply-web-config.js +20 -3
- package/src/plugins/utils/models.d.ts +9 -1
- package/src/plugins/utils/plugins/normalize-options.js +1 -0
- package/src/utils/versions.d.ts +2 -1
- package/src/utils/versions.js +3 -2
- package/src/utils/with-web.d.ts +3 -0
package/migrations.json
CHANGED
|
@@ -96,8 +96,16 @@
|
|
|
96
96
|
}
|
|
97
97
|
},
|
|
98
98
|
"20.5.0": {
|
|
99
|
-
"version": "20.5.0-beta.
|
|
99
|
+
"version": "20.5.0-beta.4",
|
|
100
100
|
"packages": {
|
|
101
|
+
"sass-embedded": {
|
|
102
|
+
"version": "^1.83.4",
|
|
103
|
+
"alwaysAddToPackageJson": true
|
|
104
|
+
},
|
|
105
|
+
"sass-loader": {
|
|
106
|
+
"version": "^16.0.4",
|
|
107
|
+
"alwaysAddToPackageJson": true
|
|
108
|
+
},
|
|
101
109
|
"@rspack/core": {
|
|
102
110
|
"version": "^1.2.2",
|
|
103
111
|
"alwaysAddToPackageJson": false
|
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.5.0-beta.
|
|
4
|
+
"version": "20.5.0-beta.5",
|
|
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/js": "20.5.0-beta.
|
|
28
|
-
"@nx/devkit": "20.5.0-beta.
|
|
29
|
-
"@nx/web": "20.5.0-beta.
|
|
30
|
-
"@nx/module-federation": "20.5.0-beta.
|
|
27
|
+
"@nx/js": "20.5.0-beta.5",
|
|
28
|
+
"@nx/devkit": "20.5.0-beta.5",
|
|
29
|
+
"@nx/web": "20.5.0-beta.5",
|
|
30
|
+
"@nx/module-federation": "20.5.0-beta.5",
|
|
31
31
|
"@phenomnomnominal/tsquery": "~5.0.1",
|
|
32
32
|
"@rspack/core": "^1.1.5",
|
|
33
33
|
"@rspack/dev-server": "^1.0.9",
|
|
@@ -42,8 +42,9 @@
|
|
|
42
42
|
"less-loader": "11.1.0",
|
|
43
43
|
"license-webpack-plugin": "^4.0.2",
|
|
44
44
|
"loader-utils": "^2.0.3",
|
|
45
|
-
"sass": "^1.
|
|
46
|
-
"sass-
|
|
45
|
+
"sass": "^1.85.0",
|
|
46
|
+
"sass-embedded": "^1.83.4",
|
|
47
|
+
"sass-loader": "^16.0.4",
|
|
47
48
|
"source-map-loader": "^5.0.0",
|
|
48
49
|
"style-loader": "^3.3.0",
|
|
49
50
|
"picocolors": "^1.1.0",
|
|
@@ -55,8 +56,8 @@
|
|
|
55
56
|
"webpack-node-externals": "^3.0.0"
|
|
56
57
|
},
|
|
57
58
|
"peerDependencies": {
|
|
58
|
-
"@module-federation/enhanced": "^0.
|
|
59
|
-
"@module-federation/node": "^2.6.
|
|
59
|
+
"@module-federation/enhanced": "^0.9.0",
|
|
60
|
+
"@module-federation/node": "^2.6.26"
|
|
60
61
|
},
|
|
61
62
|
"nx-migrations": {
|
|
62
63
|
"migrations": "./migrations.json"
|
|
@@ -22,6 +22,7 @@ function normalizeOptions(options, root, projectRoot, sourceRoot) {
|
|
|
22
22
|
styles: options.optimization,
|
|
23
23
|
}
|
|
24
24
|
: options.optimization,
|
|
25
|
+
sassImplementation: options.sassImplementation ?? 'sass',
|
|
25
26
|
};
|
|
26
27
|
if (options.assets) {
|
|
27
28
|
normalizedOptions.assets = (0, normalize_options_1.normalizeAssets)(options.assets, root, sourceRoot, projectRoot, false // executor assets are relative to workspace root for consistency
|
|
@@ -35,7 +35,12 @@ export interface RspackExecutorSchema {
|
|
|
35
35
|
sourceMap?: boolean | DevTool;
|
|
36
36
|
standardRspackConfigFunction?: boolean;
|
|
37
37
|
statsJson?: boolean;
|
|
38
|
-
stylePreprocessorOptions?:
|
|
38
|
+
stylePreprocessorOptions?: {
|
|
39
|
+
includePaths?: string[];
|
|
40
|
+
sassOptions?: Record<string, any>;
|
|
41
|
+
lessOptions?: Record<string, any>;
|
|
42
|
+
};
|
|
43
|
+
sassImplementation?: 'sass' | 'sass-embedded';
|
|
39
44
|
styles?: Array<ExtraEntryPointClass | string>;
|
|
40
45
|
target?: 'web' | 'node';
|
|
41
46
|
transformers?: TransformerEntry[];
|
|
@@ -245,10 +245,24 @@
|
|
|
245
245
|
"items": {
|
|
246
246
|
"type": "string"
|
|
247
247
|
}
|
|
248
|
+
},
|
|
249
|
+
"sassOptions": {
|
|
250
|
+
"description": "Options to pass to sass-loader.",
|
|
251
|
+
"type": "object"
|
|
252
|
+
},
|
|
253
|
+
"lessOptions": {
|
|
254
|
+
"description": "Options to pass to less-loader.",
|
|
255
|
+
"type": "object"
|
|
248
256
|
}
|
|
249
257
|
},
|
|
250
258
|
"additionalProperties": false
|
|
251
259
|
},
|
|
260
|
+
"sassImplementation": {
|
|
261
|
+
"type": "string",
|
|
262
|
+
"description": "The implementation of the SASS compiler to use. Can be either `sass` or `sass-embedded`. Defaults to `sass-embedded`.",
|
|
263
|
+
"enum": ["sass", "sass-embedded"],
|
|
264
|
+
"default": "sass"
|
|
265
|
+
},
|
|
252
266
|
"styles": {
|
|
253
267
|
"type": "array",
|
|
254
268
|
"description": "External Styles which will be included with the application",
|
|
@@ -70,6 +70,10 @@ async function rspackInitGenerator(tree, schema) {
|
|
|
70
70
|
if (schema.style === 'less') {
|
|
71
71
|
devDependencies['less-loader'] = versions_1.lessLoaderVersion;
|
|
72
72
|
}
|
|
73
|
+
if (schema.style === 'scss') {
|
|
74
|
+
devDependencies['sass-loader'] = versions_1.sassLoaderVersion;
|
|
75
|
+
devDependencies['sass-embedded'] = versions_1.sassEmbeddedVersion;
|
|
76
|
+
}
|
|
73
77
|
if (schema.framework !== 'none' || schema.devServer) {
|
|
74
78
|
devDependencies['@rspack/dev-server'] = versions_1.rspackDevServerVersion;
|
|
75
79
|
}
|
|
@@ -54,6 +54,8 @@ function applyWebConfig(options, config = {}, { useNormalizedEntry, } = {}) {
|
|
|
54
54
|
const globalStylePaths = [];
|
|
55
55
|
// Determine hashing format.
|
|
56
56
|
const hashFormat = (0, hash_format_1.getOutputHashFormat)(options.outputHashing);
|
|
57
|
+
const sassOptions = options.stylePreprocessorOptions?.sassOptions;
|
|
58
|
+
const lessOptions = options.stylePreprocessorOptions?.lessOptions;
|
|
57
59
|
const includePaths = [];
|
|
58
60
|
if (options?.stylePreprocessorOptions?.includePaths?.length > 0) {
|
|
59
61
|
options.stylePreprocessorOptions.includePaths.forEach((includePath) => includePaths.push((0, path_1.resolve)(options.root, includePath)));
|
|
@@ -88,11 +90,15 @@ function applyWebConfig(options, config = {}, { useNormalizedEntry, } = {}) {
|
|
|
88
90
|
{
|
|
89
91
|
loader: require.resolve('sass-loader'),
|
|
90
92
|
options: {
|
|
91
|
-
implementation:
|
|
93
|
+
implementation: options.sassImplementation === 'sass-embedded'
|
|
94
|
+
? require.resolve('sass-embedded')
|
|
95
|
+
: require.resolve('sass'),
|
|
96
|
+
api: 'modern-compiler',
|
|
92
97
|
sassOptions: {
|
|
93
98
|
fiber: false,
|
|
94
99
|
precision: 8,
|
|
95
100
|
includePaths,
|
|
101
|
+
...(sassOptions ?? {}),
|
|
96
102
|
},
|
|
97
103
|
},
|
|
98
104
|
},
|
|
@@ -108,6 +114,7 @@ function applyWebConfig(options, config = {}, { useNormalizedEntry, } = {}) {
|
|
|
108
114
|
options: {
|
|
109
115
|
lessOptions: {
|
|
110
116
|
paths: includePaths,
|
|
117
|
+
...(lessOptions ?? {}),
|
|
111
118
|
},
|
|
112
119
|
},
|
|
113
120
|
},
|
|
@@ -143,13 +150,17 @@ function applyWebConfig(options, config = {}, { useNormalizedEntry, } = {}) {
|
|
|
143
150
|
{
|
|
144
151
|
loader: require.resolve('sass-loader'),
|
|
145
152
|
options: {
|
|
146
|
-
|
|
153
|
+
api: 'modern-compiler',
|
|
154
|
+
implementation: options.sassImplementation === 'sass-embedded'
|
|
155
|
+
? require.resolve('sass-embedded')
|
|
156
|
+
: require.resolve('sass'),
|
|
147
157
|
sourceMap: !!options.sourceMap,
|
|
148
158
|
sassOptions: {
|
|
149
159
|
fiber: false,
|
|
150
160
|
// bootstrap-sass requires a minimum precision of 8
|
|
151
161
|
precision: 8,
|
|
152
162
|
includePaths,
|
|
163
|
+
...(sassOptions ?? {}),
|
|
153
164
|
},
|
|
154
165
|
},
|
|
155
166
|
},
|
|
@@ -167,6 +178,7 @@ function applyWebConfig(options, config = {}, { useNormalizedEntry, } = {}) {
|
|
|
167
178
|
lessOptions: {
|
|
168
179
|
javascriptEnabled: true,
|
|
169
180
|
...lessPathOptions,
|
|
181
|
+
...(lessOptions ?? {}),
|
|
170
182
|
},
|
|
171
183
|
},
|
|
172
184
|
},
|
|
@@ -203,13 +215,17 @@ function applyWebConfig(options, config = {}, { useNormalizedEntry, } = {}) {
|
|
|
203
215
|
{
|
|
204
216
|
loader: require.resolve('sass-loader'),
|
|
205
217
|
options: {
|
|
206
|
-
|
|
218
|
+
api: 'modern-compiler',
|
|
219
|
+
implementation: options.sassImplementation === 'sass-embedded'
|
|
220
|
+
? require.resolve('sass-embedded')
|
|
221
|
+
: require.resolve('sass'),
|
|
207
222
|
sourceMap: !!options.sourceMap,
|
|
208
223
|
sassOptions: {
|
|
209
224
|
fiber: false,
|
|
210
225
|
// bootstrap-sass requires a minimum precision of 8
|
|
211
226
|
precision: 8,
|
|
212
227
|
includePaths,
|
|
228
|
+
...(sassOptions ?? {}),
|
|
213
229
|
},
|
|
214
230
|
},
|
|
215
231
|
},
|
|
@@ -227,6 +243,7 @@ function applyWebConfig(options, config = {}, { useNormalizedEntry, } = {}) {
|
|
|
227
243
|
lessOptions: {
|
|
228
244
|
javascriptEnabled: true,
|
|
229
245
|
...lessPathOptions,
|
|
246
|
+
...(lessOptions ?? {}),
|
|
230
247
|
},
|
|
231
248
|
},
|
|
232
249
|
},
|
|
@@ -148,6 +148,10 @@ export interface NxAppRspackPluginOptions {
|
|
|
148
148
|
* Add an additional chunk for the rspack runtime. Defaults to `true` when `target === 'web'`.
|
|
149
149
|
*/
|
|
150
150
|
runtimeChunk?: boolean;
|
|
151
|
+
/**
|
|
152
|
+
* The implementation of the SASS compiler to use. Can be either `sass` or `sass-embedded`. Defaults to `sass-embedded`.
|
|
153
|
+
*/
|
|
154
|
+
sassImplementation?: 'sass' | 'sass-embedded';
|
|
151
155
|
/**
|
|
152
156
|
* External scripts that will be included before the main application entry.
|
|
153
157
|
*/
|
|
@@ -183,7 +187,11 @@ export interface NxAppRspackPluginOptions {
|
|
|
183
187
|
/**
|
|
184
188
|
* Options for the style preprocessor. e.g. `{ "includePaths": [] }` for SASS.
|
|
185
189
|
*/
|
|
186
|
-
stylePreprocessorOptions?:
|
|
190
|
+
stylePreprocessorOptions?: {
|
|
191
|
+
includePaths?: string[];
|
|
192
|
+
sassOptions?: Record<string, any>;
|
|
193
|
+
lessOptions?: Record<string, any>;
|
|
194
|
+
};
|
|
187
195
|
/**
|
|
188
196
|
* External stylesheets that will be included with the application.
|
|
189
197
|
*/
|
|
@@ -77,6 +77,7 @@ function normalizeOptions(options) {
|
|
|
77
77
|
projectRoot: projectNode.data.root,
|
|
78
78
|
root: devkit_1.workspaceRoot,
|
|
79
79
|
runtimeChunk: combinedPluginAndMaybeExecutorOptions.runtimeChunk ?? true,
|
|
80
|
+
sassImplementation: combinedPluginAndMaybeExecutorOptions.sassImplementation ?? 'sass',
|
|
80
81
|
scripts: combinedPluginAndMaybeExecutorOptions.scripts ?? [],
|
|
81
82
|
sourceMap: combinedPluginAndMaybeExecutorOptions.sourceMap ?? !isProd,
|
|
82
83
|
sourceRoot,
|
package/src/utils/versions.d.ts
CHANGED
|
@@ -4,13 +4,14 @@ export declare const rspackDevServerVersion = "1.0.9";
|
|
|
4
4
|
export declare const rspackPluginMinifyVersion = "^0.7.5";
|
|
5
5
|
export declare const rspackPluginReactRefreshVersion = "^1.0.0";
|
|
6
6
|
export declare const lessLoaderVersion = "~11.1.3";
|
|
7
|
+
export declare const sassLoaderVersion = "^16.0.4";
|
|
8
|
+
export declare const sassEmbeddedVersion = "^1.83.4";
|
|
7
9
|
export declare const reactRefreshVersion = "~0.14.0";
|
|
8
10
|
export declare const nestjsCommonVersion = "~9.0.0";
|
|
9
11
|
export declare const nestjsCoreVersion = "~9.0.0";
|
|
10
12
|
export declare const nestjsPlatformExpressVersion = "~9.0.0";
|
|
11
13
|
export declare const nestjsMicroservicesVersion = "~9.0.0";
|
|
12
14
|
export declare const lessVersion = "4.1.3";
|
|
13
|
-
export declare const sassVersion = "^1.42.1";
|
|
14
15
|
export declare const stylusVersion = "^0.55.0";
|
|
15
16
|
export declare const eslintPluginImportVersion = "2.27.5";
|
|
16
17
|
export declare const eslintPluginJsxA11yVersion = "6.7.1";
|
package/src/utils/versions.js
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.eslintPluginReactHooksVersion = exports.eslintPluginReactVersion = exports.eslintPluginJsxA11yVersion = exports.eslintPluginImportVersion = exports.stylusVersion = exports.
|
|
3
|
+
exports.eslintPluginReactHooksVersion = exports.eslintPluginReactVersion = exports.eslintPluginJsxA11yVersion = exports.eslintPluginImportVersion = exports.stylusVersion = exports.lessVersion = exports.nestjsMicroservicesVersion = exports.nestjsPlatformExpressVersion = exports.nestjsCoreVersion = exports.nestjsCommonVersion = exports.reactRefreshVersion = exports.sassEmbeddedVersion = exports.sassLoaderVersion = exports.lessLoaderVersion = exports.rspackPluginReactRefreshVersion = exports.rspackPluginMinifyVersion = exports.rspackDevServerVersion = exports.rspackCoreVersion = exports.nxVersion = void 0;
|
|
4
4
|
exports.nxVersion = require('../../package.json').version;
|
|
5
5
|
exports.rspackCoreVersion = '1.2.2';
|
|
6
6
|
exports.rspackDevServerVersion = '1.0.9';
|
|
7
7
|
exports.rspackPluginMinifyVersion = '^0.7.5';
|
|
8
8
|
exports.rspackPluginReactRefreshVersion = '^1.0.0';
|
|
9
9
|
exports.lessLoaderVersion = '~11.1.3';
|
|
10
|
+
exports.sassLoaderVersion = '^16.0.4';
|
|
11
|
+
exports.sassEmbeddedVersion = '^1.83.4';
|
|
10
12
|
exports.reactRefreshVersion = '~0.14.0';
|
|
11
13
|
exports.nestjsCommonVersion = '~9.0.0';
|
|
12
14
|
exports.nestjsCoreVersion = '~9.0.0';
|
|
13
15
|
exports.nestjsPlatformExpressVersion = '~9.0.0';
|
|
14
16
|
exports.nestjsMicroservicesVersion = '~9.0.0';
|
|
15
17
|
exports.lessVersion = '4.1.3';
|
|
16
|
-
exports.sassVersion = '^1.42.1';
|
|
17
18
|
exports.stylusVersion = '^0.55.0';
|
|
18
19
|
exports.eslintPluginImportVersion = '2.27.5';
|
|
19
20
|
exports.eslintPluginJsxA11yVersion = '6.7.1';
|
package/src/utils/with-web.d.ts
CHANGED
|
@@ -8,10 +8,13 @@ export interface WithWebOptions {
|
|
|
8
8
|
generateIndexHtml?: boolean;
|
|
9
9
|
index?: string;
|
|
10
10
|
postcssConfig?: string;
|
|
11
|
+
sassImplementation?: 'sass' | 'sass-embedded';
|
|
11
12
|
scripts?: Array<ExtraEntryPointClass | string>;
|
|
12
13
|
styles?: Array<ExtraEntryPointClass | string>;
|
|
13
14
|
stylePreprocessorOptions?: {
|
|
14
15
|
includePaths?: string[];
|
|
16
|
+
sassOptions?: Record<string, any>;
|
|
17
|
+
lessOptions?: Record<string, any>;
|
|
15
18
|
};
|
|
16
19
|
cssModules?: boolean;
|
|
17
20
|
ssr?: boolean;
|