vue框架搭建后,相使用scss编译,效果如下:
./src/components/HelloWorld.vue
Module not found: Error: Can't resolve 'sass-loader' in 'D:\pro\admin\src\components'
@ ./src/components/HelloWorld.vue 4:2-353
@ ./src/router/index.js
@ ./src/main.js
@ multi ./node_modules/_webpack-dev-server@2.11.5@webpack-dev-server/client?http://localhost:8081 webpack/hot/dev-server ./src/main.js
根据错误信息安装所需模块:
cnpm install node-sass sass-loader vue-style-loader --save-dev
安装成功后报错如下:
./node_modules/_css-loader@0.28.11@css-loader?{"sourceMap":true}!./node_modules/_vue-loader@13.7.3@vue-loader/lib/style-compiler?{"vue":true,"id":"data-v-469af010","scoped":true,"hasInlineConfig":false}!./node_modules/_sass-loader@8.0.0@sass-loader/dist/cjs.js?{"sourceMap":true}!./node_modules/_vue-l