Compile error:less Syntax error: Unknown word

created at 08-16-2021 views: 2

Solution

Modify the webpack configuration file and configure less in the module rules:

{
    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'),
},
created at:08-16-2021
edited at: 08-16-2021: