nextjs 升级7.0.0后编译错误Error: Chunk.entrypoints: Use Chunks.groupsIterable and filter by instanceof Entrypoint instead

前端之家收集整理的这篇文章主要介绍了nextjs 升级7.0.0后编译错误Error: Chunk.entrypoints: Use Chunks.groupsIterable and filter by instanceof Entrypoint instead前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

错误
Error: Chunk.entrypoints: Use Chunks.groupsIterable and filter by instanceof Entrypoint instead
解决方式:
修改webpack.config.js使用mini-css-extract-plugin

const devMode = process.env.NODE_ENV !== 'production';

module.exports = {
plugins: [
new MiniCssExtractPlugin({
// Options similar to the same options in webpackOptions.output
// both options are optional
filename : devMode ? '[name].css' : '[name].[hash].css',chunkFilename : devMode ? '[id].css' : '[id].[hash].css'
})
],module: {
rules: [
{
test : /.(sa|sc|c)ss$/,use : [
devMode ? 'style-loader' : MiniCssExtractPlugin.loader,'css-loader','postcss-loader','sass-loader'
]
}
]
}
};```

猜你在找的程序笔记相关文章