webpack 1.x升级过程中的踩坑总结大全

错误:Error: Chunk.entry was removed. Use hasRuntime()

 

卸载npm uninstall extract-text-webpack-plugin --save-dev

重新下载 npm install extract-text-webpack-plugin@^2.0.0-beta.4

错误:Error: Breaking change: extract now only takes a single argument.

 

原因是webpack2对loader的配置做了一些调整,修改 ExtractTextPlugin配置即可:

{
 test: /\.less$/,
 use: ExtractTextPlugin.extract({
  fallback: 'style-loader',
  use: ['css-loader', 'less-loader']
 })
},

 

posted @ 2018-02-23 22:24  松歌  阅读(126)  评论(0编辑  收藏  举报