内容安全策略 (CSP) 不喜欢 webpack 的样式加载器如何使用 appendChild
.任何想法如何自定义这些工具以协同工作?
最佳答案
有一个新的attr
style-loader 中的选项允许您将自定义属性添加到 <script>
标签。我用它来添加 nonce
属性:
{
loader: 'style-loader',
options: {
attrs: {
nonce: 'devOnly',
}
}
}
ExtractTextPlugin
进行生产):style-src 'self' 'nonce-devOnly'
https://stackoverflow.com/questions/41326019/
相关文章:
angularjs - 在 Controller 函数之外的脚本中读取 AngularJS 表达式
C - do/while 循环和 switch(int)。输入 char 值会导致 inf。环形
android - 安装失败 INSTALL_PARSE_FAILED_MANIFEST_MALFO
apache-spark - Spark 溢出独立于分配的执行程序内存
angularjs - 在带有过滤的ng-repeat中反向计数
.net - Android Xamarin - 带有 ObservableCollection 的
sprite-kit - SpriteKit : calculate distance betwee