webpack less Unexpected character '@' (1:0)

rules: [
{
test: /\.(sa|sc|c)ss$/,
use: [
devMode ? "style-loader" : MiniCssExtractPlugin.loader,
"css-loader",
"less-loader",
"sass-loader",
],
},]

  

  改为 (增加正则匹配)  
rules: [
{
test: /\.(le|sa|sc|c)ss$/,
use: [
devMode ? "style-loader" : MiniCssExtractPlugin.loader,
"css-loader",
"less-loader",
"sass-loader",
],
},

  

上一篇:12-提取css成单独文件


下一篇:webpack学习笔记