import './index.less'
"less": "^4.1.1",
"less-loader": "^6.0.0",
//50行
const lessRegex = /\.less$/;
const lessModuleRegex = /\.module\.less$/;
// oneof[]添加
{
test: lessRegex,
exclude: lessModuleRegex,
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'
),
},
<div className="login">
<div className="top">top</div>
<div className="left"></div>
<div className="right"></div>
</div>
.login{
// background: url(../../assets/bg_login.jpg);
// width: 100%;
// height: 100%;
.top{
color: red;
}
}