【发布时间】:2021-03-17 16:39:15
【问题描述】:
我正在尝试将 webpack style-loader nonce attribute 添加到 craco config file,用于 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 实现这一点以及如何实现?
【问题讨论】:
标签: javascript webpack create-react-app craco