You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat!: deprecate css.modules in favor of css.requireModuleExtension (#4387)
closes#4376
Since css-loader v3, custom CSS Modules configurations are under the
`modules` field. So when a user customizes these configurations, the `modules`
feature is automatically enabled for all css files.
So we must require the user's explicit consensus or disagreement on whether
these rules apply to all CSS files or not.
Copy file name to clipboardExpand all lines: docs/config/README.md
+12-2Lines changed: 12 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -247,10 +247,20 @@ See [the plugin's README](https://github.com/vuejs/vue-cli/blob/dev/packages/%40
247
247
248
248
### css.modules
249
249
250
+
Deprecated since v4, please use [`css.requireModuleExtension`](#css-requireModuleExtension) instead.
251
+
252
+
In v3 this means the opposite of `css.requireModuleExtension`.
253
+
254
+
### css.requireModuleExtension
255
+
250
256
- Type: `boolean`
251
-
- Default: `false`
257
+
- Default: `true`
258
+
259
+
By default, only files that ends in `*.module.[ext]` are treated as CSS modules. Setting this to `false` will allow you to drop `.module` in the filenames and treat all `*.(css|scss|sass|less|styl(us)?)` files as CSS modules.
252
260
253
-
By default, only files that ends in `*.module.[ext]` are treated as CSS modules. Setting this to `true` will allow you to drop `.module` in the filenames and treat all `*.(css|scss|sass|less|styl(us)?)` files as CSS modules.
261
+
::: tip
262
+
If you have customized CSS Modules configurations in `css.loaderOptions.css`, then the `css.requireModuleExtension` field must be explictly configured to `true` or `false`, otherwise we can't be sure whether you want to apply these options to all CSS files or not.
263
+
:::
254
264
255
265
See also: [Working with CSS > CSS Modules](../guide/css.md#css-modules)
0 commit comments