webpack4.0 中使用extract-text-webpack-plugin報錯??Error: Path variable [contenthash] not implemented in this context: [name].[contenthash].css
Error: Path variable [contenthash] not implemented in this context: [name].[contenthash].css
Error: Path variable [contenthash] not implemented in this context: [name].[contenthash].css
2018-07-16
舉報
2018-07-18
可以參考這篇文章
https://blog.csdn.net/harsima/article/details/80819747
2020-03-03
在之前版本中我們使用
extract-text-webpack-plugin
來提取CSS文件,不過在webpack 4.x中則應該使用mini-css-extract-plugin
來提取CSS到單獨文件中基于webpack 3.0的Vue項目
基于webpack 4.0的Vue項目
2018-11-12
我把contenthash改成了hash就編譯通過了
2018-07-18
util.js
刪掉 ExtractTextPlugin,改用 MiniCssExtractPlugin?
```
if (options.extract) {
let extractLoader = {
loader: MiniCssExtractPlugin.loader,
options: {}
}
return [extractLoader, 'css-loader'].concat(['postcss-loader'], loaders)
} else {
return ['vue-style-loader', 'css-loader'].concat(['postcss-loader'], loaders)
}
```