gpt4 book ai didi

javascript - 在本地设置 react CSS 加载器,但出现错误

转载 作者:行者123 更新时间:2023-11-28 16:50:04 26 4
gpt4 key购买 nike

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

错误是:

./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? }

最佳答案

您正在使用 css-loader 3.0.x that has moved localIdentName into the modules object .

尝试

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

代替

modules: true,

关于javascript - 在本地设置 react CSS 加载器,但出现错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59353023/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com