npm i
npm run build -- index.js
Last active
September 10, 2020 06:58
-
-
Save ogonkov/d4060500cf3d5b8b78e61fac9b8befe9 to your computer and use it in GitHub Desktop.
Mini CSS Extract Plugin error webpack-contrib/mini-css-extract-plugin#205
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import styles from './item.css'; | |
console.log(styles); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.item { | |
color: red; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"private": true, | |
"name": "example", | |
"scripts": { | |
"build": "webpack" | |
}, | |
"devDependencies": { | |
"css-loader": "^4.3.0", | |
"mini-css-extract-plugin": "^0.11.0", | |
"webpack": "^4.44.1", | |
"webpack-cli": "^3.3.12" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const MiniCssExtractPlugin = require('mini-css-extract-plugin'); | |
module.exports = { | |
mode: 'development', | |
devtool: false, | |
module: { | |
rules: [ | |
{ | |
test: /\.css$/, | |
use: [ | |
{ | |
loader: MiniCssExtractPlugin.loader | |
}, | |
{ | |
loader: 'css-loader', | |
options: { | |
modules: { | |
exportOnlyLocals: true | |
} | |
} | |
} | |
] | |
} | |
] | |
}, | |
plugins: [ | |
new MiniCssExtractPlugin(), | |
] | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment