vue中执行npm run build报错解决方法?

遇到了执行npm run build 后报错:

[build:js ] Module not found: Error: Can't resolve 'scss-loader' in 'D:\works\works\H5-IM\im-h5\src\pages'

在webpack.config.js里面加:

test: /\.vue$/,
loader: 'vue-loader',
options: {
autoprefixer: false,
loaders: {
scss: 'vue-style-loader!css-loader!sass-loader',
sass: 'vue-style-loader!css-loader!sass-loader?indentedSyntax',
},
OK,解决啦!收藏一波
posted @ 2019-08-06 10:58  指尖流年1218  阅读(3005)  评论(0编辑  收藏  举报