我正在尝试将 webpack style-loader nonce 属性添加到craco 配置文件中,用于 create-react-app,如下所示:
// craco.config.js
module.exports = {
webpack: {
module: {
rules: [
{
test: /\.css$/i,
use: [
{
loader: "style-loader",
options: {
attributes: {
nonce: "12345678",
},
},
},
"css-loader",
],
},
],
},
},
};
但这没有用。有没有人可以用craco实现这一点以及如何实现?