I see the following errors when trying to start my app...
> css-modules@1.0.0 start /Users/johnnynolan/Repos/css-modules
webp
Yea, I got the same issue with webpack 4.10.2
. The problem is fixed after I swap the extract-css-chunks-webpack-plugin
to mini-css-extract-plugin
.
Here's the webpack config changes:
-const ExtractCssChunks = require('extract-css-chunks-webpack-plugin')
+const MiniCssExtractPlugin = require("mini-css-extract-plugin");
module.exports = {
name: 'client',
target: 'web',
module: {
rules: [
{
test: /\.css$/,
- use: ExtractCssChunks.extract({
- use: 'css-loader'
- })
+ use: [
+ {
+ loader: MiniCssExtractPlugin.loader,
+ },
+ "css-loader"
+ ]
}
]
},
//
// other config........
//
plugins: [
- new ExtractCssChunks(),
+ new MiniCssExtractPlugin({
+ filename: `components/[name].css`
+ }),
//
// other config........
//
]
Hope it can help.