一、安装对应依赖node模块:
npm install node-sass --save-dev npm install sass-loader --save-dev
二、打开webpack.base.config.js在loaders里面加上:
{ test: /\.scss$/, loaders: ["style", "css", "sass"] } module: { rules: [ {
test: /\.vue$/, loader: 'vue-loader', options: vueLoaderConfig }, { test:
/\.js$/, loader: 'babel-loader', include: [resolve('src'), resolve('test'),
resolve('node_modules/webpack-dev-server/client')] }, { test:
/\.(png|jpe?g|gif|svg)(\?.*)?$/, loader: 'url-loader', options: { limit: 10000,
name: utils.assetsPath('img/[name].[hash:7].[ext]') } }, { test: /\.scss$/,
loaders: ["style", "css", "sass"] }, { test:
/\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/, loader: 'url-loader', options: {
limit: 10000, name: utils.assetsPath('media/[name].[hash:7].[ext]') } }, {
test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/, loader: 'url-loader', options: { limit:
10000, name: utils.assetsPath('fonts/[name].[hash:7].[ext]') } } ] }
三、在用scss的地方写上:
<style lang="scss" scoped=""></style>
 

技术
今日推荐
下载桌面版
GitHub
百度网盘(提取码:draw)
Gitee
云服务器优惠
阿里云优惠券
腾讯云优惠券
华为云优惠券
站点信息
问题反馈
邮箱:[email protected]
QQ群:766591547
关注微信