npm install less-loader less --save-dev
module.exports={ //...code module:{ rules:[ { //匹配规则 test:/\.less$/, //loader加载顺序 不能颠倒 use: ['style-loader', 'css-loader','less-loader'] } ] } }
index.js
import "./../less/index.less"
Last updated 4 years ago