webpack打包处理less/scss文件

less配置:

npm i less -d
npm i less-loader -d

sass/scs配置:

npm i node-sass -d
npm i sass-loader -d

然后修改webpack.config.js的配置文件:

webpack打包处理less/scss文件_第1张图片

{test: /\.scss$/, use: ['style-loader','css-loader','sass-loader']},
{test: /\.less$/, use: ['style-loader','css-loader','less-loader']},

 

你可能感兴趣的:(webpack)