0
test: cssRegex,
exclude: cssModuleRegex,
use: getStyleLoaders({
    importLoaders: 1,
    modules: true,
    localIdentName: "[name]__[local]__[hash:base64:5]",
    sourceMap: isEnvProduction && shouldUseSourceMap,
}),

And the error is:

./src/index.css (./node_modules/css-loader/dist/cjs.js??ref--6-oneOf-3-1!./node_modules/postcss-loader/src??postcss!./src/index.css) ValidationError: Invalid options object. CSS Loader has been initialised using an options object that does not match the API schema. - options has an unknown property 'localIdentName'. These properties are valid: object { url?, import?, modules?, sourceMap?, importLoaders?, localsConvention?, onlyLocals? }

1 Answer 1

7

You're using a css-loader 3.0.x that has moved localIdentName into the modules object.

Try

modules: {
  localIdentName: "[name]__[local]__[hash:base64:5]",
},

instead of

modules: true,
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.