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.
This commit is contained in:
Haoqun Jiang
2019-08-02 21:14:39 +08:00
committed by GitHub
parent 96eac78f6e
commit e9fd9a716c
8 changed files with 174 additions and 13 deletions
+2 -2
View File
@@ -89,13 +89,13 @@ import styles from './foo.module.css'
import sassStyles from './foo.module.scss'
```
If you want to drop the `.module` in the filenames, set `css.modules` to `true` in `vue.config.js`:
If you want to drop the `.module` in the filenames, set `css.requireModuleExtension` to `false` in `vue.config.js`:
``` js
// vue.config.js
module.exports = {
css: {
modules: true
requireModuleExtension: false
}
}
```