Skip to content

Commit defa5d4

Browse files
authored
chore(deps): bump css-loader v7 and set namedExport default value (#2110)
1 parent d403fb2 commit defa5d4

File tree

20 files changed

+81
-83
lines changed

20 files changed

+81
-83
lines changed

packages/compat/webpack/tests/__snapshots__/css.test.ts.snap

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ exports[`plugin-css > should not apply postcss-loader when target is node 1`] =
2323
"exportLocalsConvention": "camelCase",
2424
"exportOnlyLocals": true,
2525
"localIdentName": "[path][name]__[local]-[hash:base64:6]",
26+
"namedExport": false,
2627
},
2728
"sourceMap": false,
2829
},
@@ -56,6 +57,7 @@ exports[`plugin-css > should override browserslist of autoprefixer when using ou
5657
"auto": true,
5758
"exportLocalsConvention": "camelCase",
5859
"localIdentName": "[path][name]__[local]-[hash:base64:6]",
60+
"namedExport": false,
5961
},
6062
"sourceMap": false,
6163
},
@@ -114,6 +116,7 @@ exports[`plugin-css > should remove some postcss plugins based on browserslist 1
114116
"auto": true,
115117
"exportLocalsConvention": "camelCase",
116118
"localIdentName": "[path][name]__[local]-[hash:base64:6]",
119+
"namedExport": false,
117120
},
118121
"sourceMap": false,
119122
},

packages/compat/webpack/tests/__snapshots__/default.test.ts.snap

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ exports[`applyDefaultPlugins > should apply default plugins correctly 1`] = `
176176
"auto": true,
177177
"exportLocalsConvention": "camelCase",
178178
"localIdentName": "[path][name]__[local]-[hash:base64:6]",
179+
"namedExport": false,
179180
},
180181
"sourceMap": false,
181182
},
@@ -231,6 +232,7 @@ exports[`applyDefaultPlugins > should apply default plugins correctly 1`] = `
231232
"auto": true,
232233
"exportLocalsConvention": "camelCase",
233234
"localIdentName": "[path][name]__[local]-[hash:base64:6]",
235+
"namedExport": false,
234236
},
235237
"sourceMap": false,
236238
},
@@ -300,6 +302,7 @@ exports[`applyDefaultPlugins > should apply default plugins correctly 1`] = `
300302
"auto": true,
301303
"exportLocalsConvention": "camelCase",
302304
"localIdentName": "[path][name]__[local]-[hash:base64:6]",
305+
"namedExport": false,
303306
},
304307
"sourceMap": false,
305308
},
@@ -707,6 +710,7 @@ exports[`applyDefaultPlugins > should apply default plugins correctly when produ
707710
"auto": true,
708711
"exportLocalsConvention": "camelCase",
709712
"localIdentName": "[local]-[hash:base64:6]",
713+
"namedExport": false,
710714
},
711715
"sourceMap": false,
712716
},
@@ -762,6 +766,7 @@ exports[`applyDefaultPlugins > should apply default plugins correctly when produ
762766
"auto": true,
763767
"exportLocalsConvention": "camelCase",
764768
"localIdentName": "[local]-[hash:base64:6]",
769+
"namedExport": false,
765770
},
766771
"sourceMap": false,
767772
},
@@ -831,6 +836,7 @@ exports[`applyDefaultPlugins > should apply default plugins correctly when produ
831836
"auto": true,
832837
"exportLocalsConvention": "camelCase",
833838
"localIdentName": "[local]-[hash:base64:6]",
839+
"namedExport": false,
834840
},
835841
"sourceMap": false,
836842
},
@@ -1281,6 +1287,7 @@ exports[`applyDefaultPlugins > should apply default plugins correctly when targe
12811287
"exportLocalsConvention": "camelCase",
12821288
"exportOnlyLocals": true,
12831289
"localIdentName": "[local]-[hash:base64:6]",
1290+
"namedExport": false,
12841291
},
12851292
"sourceMap": false,
12861293
},
@@ -1306,6 +1313,7 @@ exports[`applyDefaultPlugins > should apply default plugins correctly when targe
13061313
"exportLocalsConvention": "camelCase",
13071314
"exportOnlyLocals": true,
13081315
"localIdentName": "[local]-[hash:base64:6]",
1316+
"namedExport": false,
13091317
},
13101318
"sourceMap": false,
13111319
},
@@ -1345,6 +1353,7 @@ exports[`applyDefaultPlugins > should apply default plugins correctly when targe
13451353
"exportLocalsConvention": "camelCase",
13461354
"exportOnlyLocals": true,
13471355
"localIdentName": "[local]-[hash:base64:6]",
1356+
"namedExport": false,
13481357
},
13491358
"sourceMap": false,
13501359
},
@@ -1620,6 +1629,7 @@ exports[`applyDefaultPlugins > should apply default plugins correctly when targe
16201629
"exportLocalsConvention": "camelCase",
16211630
"exportOnlyLocals": true,
16221631
"localIdentName": "[local]-[hash:base64:6]",
1632+
"namedExport": false,
16231633
},
16241634
"sourceMap": false,
16251635
},
@@ -1645,6 +1655,7 @@ exports[`applyDefaultPlugins > should apply default plugins correctly when targe
16451655
"exportLocalsConvention": "camelCase",
16461656
"exportOnlyLocals": true,
16471657
"localIdentName": "[local]-[hash:base64:6]",
1658+
"namedExport": false,
16481659
},
16491660
"sourceMap": false,
16501661
},
@@ -1684,6 +1695,7 @@ exports[`applyDefaultPlugins > should apply default plugins correctly when targe
16841695
"exportLocalsConvention": "camelCase",
16851696
"exportOnlyLocals": true,
16861697
"localIdentName": "[local]-[hash:base64:6]",
1698+
"namedExport": false,
16871699
},
16881700
"sourceMap": false,
16891701
},

packages/core/tests/__snapshots__/css.test.ts.snap

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,7 @@ exports[`plugin-css injectStyles > should apply ignoreCssLoader when injectStyle
368368
"exportLocalsConvention": "camelCase",
369369
"exportOnlyLocals": true,
370370
"localIdentName": "[path][name]__[local]-[hash:base64:6]",
371+
"namedExport": false,
371372
},
372373
"sourceMap": false,
373374
},
@@ -404,6 +405,7 @@ exports[`plugin-css injectStyles > should use css-loader + style-loader when inj
404405
"auto": true,
405406
"exportLocalsConvention": "camelCase",
406407
"localIdentName": "[path][name]__[local]-[hash:base64:6]",
408+
"namedExport": false,
407409
},
408410
"sourceMap": false,
409411
},
@@ -589,6 +591,7 @@ exports[`plugin-less > should add less-loader and css-loader when injectStyles 1
589591
"auto": true,
590592
"exportLocalsConvention": "camelCase",
591593
"localIdentName": "[path][name]__[local]-[hash:base64:6]",
594+
"namedExport": false,
592595
},
593596
"sourceMap": false,
594597
},
@@ -1037,6 +1040,7 @@ exports[`plugin-sass > should add sass-loader and css-loader when injectStyles 1
10371040
"auto": true,
10381041
"exportLocalsConvention": "camelCase",
10391042
"localIdentName": "[path][name]__[local]-[hash:base64:6]",
1043+
"namedExport": false,
10401044
},
10411045
"sourceMap": false,
10421046
},

packages/document/docs/en/config/tools/css-loader.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
The config of [css-loader](https://github.com/webpack-contrib/css-loader) can be modified through `tools.cssLoader`. The default config is as follows:
77

88
```js
9-
{
9+
const defaultOptions = {
1010
modules: {
1111
auto: true,
12+
namedExport: false,
1213
exportLocalsConvention: 'camelCase',
1314
localIdentName: rsbuildConfig.output.cssModules.localIdentName,
1415
// isServer indicates node (SSR) build
@@ -18,7 +19,7 @@ The config of [css-loader](https://github.com/webpack-contrib/css-loader) can be
1819
sourceMap: rsbuildConfig.output.sourceMap.css,
1920
// importLoaders is `1` when compiling css files, and is `2` when compiling sass/less files
2021
importLoaders: 1 || 2,
21-
}
22+
};
2223
```
2324

2425
:::tip

packages/document/docs/zh/config/tools/css-loader.mdx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
通过 `tools.cssLoader` 可以修改 [css-loader](https://github.com/webpack-contrib/css-loader) 的配置项。默认配置如下:
77

88
```js
9-
{
9+
const defaultOptions = {
1010
modules: {
1111
auto: true,
12+
namedExport: false,
1213
exportLocalsConvention: 'camelCase',
1314
localIdentName: rsbuildConfig.output.cssModules.localIdentName,
1415
// isServer 表示 node (SSR) 构建
@@ -18,7 +19,7 @@
1819
sourceMap: rsbuildConfig.output.sourceMap.css,
1920
// importLoaders 在编译 css 文件时为 `1`,在编译 sass/less 文件时为 `2`
2021
importLoaders: 1 || 2,
21-
}
22+
};
2223
```
2324

2425
:::tip

packages/plugin-babel/compiled/babel-loader/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/shared/compiled/css-loader/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"name":"css-loader","author":"Tobias Koppers @sokra","version":"6.11.0","funding":{"type":"opencollective","url":"https://opencollective.com/webpack"},"license":"MIT","types":"index.d.ts","type":"commonjs"}
1+
{"name":"css-loader","author":"Tobias Koppers @sokra","version":"7.1.1","funding":{"type":"opencollective","url":"https://opencollective.com/webpack"},"license":"MIT","types":"index.d.ts","type":"commonjs"}

packages/shared/compiled/postcss-loader/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/shared/compiled/postcss-modules-local-by-default/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)