admin管理员组文章数量:1430509
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? }
test: cssRegex,
exclude: cssModuleRegex,
use: getStyleLoaders({
importLoaders: 1,
modules: true,
localIdentName: "[name]__[local]__[hash:base64:5]",
sourceMap: isEnvProduction && shouldUseSourceMap,
}),
And the error is:
Share Improve this question edited Dec 16, 2019 at 9:03 scuberula 351 silver badge10 bronze badges asked Dec 16, 2019 at 8:41 Zulfiqar Hussain AnjumZulfiqar Hussain Anjum 391 silver badge6 bronze badges./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
Reset to default 7You'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,
本文标签: javascriptSet the react CSS loader in locallybut I get an errorStack Overflow
版权声明:本文标题:javascript - Set the react CSS loader in locally, but I get an error - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745481818a2660207.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论