- 需要先爆漏webpack的配置文件
npm run eject
- 先安装对应的loader
yarn add node-sass sass-loader
- 修改代码(文件:webpack.config.dev.js)
,/\.scss$/
{ test: /\.scss$/, loaders: ['style-loader', 'css-loader', 'sass-loader'], }
npm run eject
yarn add node-sass sass-loader
,/\.scss$/
{ test: /\.scss$/, loaders: ['style-loader', 'css-loader', 'sass-loader'], }