时间:2023-02-15 13:14:52 | 栏目: | 点击:次
npm install less-loader less --save-dev
在这个下面添加less相关配置
const lessRegex = /\.less$/; const lessModuleRegex = /\.module\.less$/;
在这段代码下面加
{ test: lessRegex, exclude: sassModuleRegex, use: getStyleLoaders( { importLoaders: 2, sourceMap: isEnvProduction && shouldUseSourceMap, }, 'less-loader' ), sideEffects: true, }, { test: lessModuleRegex, use: getStyleLoaders( { importLoaders: 2, sourceMap: isEnvProduction && shouldUseSourceMap, modules: true, getLocalIdent: getCSSModuleLocalIdent, }, 'less-loader' ), },
npm install less-loader@6.0.0