浏览代码

Re-enables CSP for production

main
Eric Amodio 2 年前
父节点
当前提交
1dc14411c6
共有 1 个文件被更改,包括 6 次插入3 次删除
  1. +6
    -3
      webpack.config.js

+ 6
- 3
webpack.config.js 查看文件

@ -443,7 +443,10 @@ function getCspHtmlPlugin(mode, env) {
mode !== 'production'
? ['#{cspSource}', "'nonce-#{cspNonce}'", "'unsafe-eval'"]
: ['#{cspSource}', "'nonce-#{cspNonce}'"],
'style-src': ['#{cspSource}', "'unsafe-hashes'", "'unsafe-inline'"],
'style-src':
mode === 'production'
? ['#{cspSource}', "'nonce-#{cspNonce}'", "'unsafe-hashes'"]
: ['#{cspSource}', "'unsafe-hashes'", "'unsafe-inline'"],
'font-src': ['#{cspSource}'],
},
{
@ -451,11 +454,11 @@ function getCspHtmlPlugin(mode, env) {
hashingMethod: 'sha256',
hashEnabled: {
'script-src': true,
'style-src': false,
'style-src': mode === 'production',
},
nonceEnabled: {
'script-src': true,
'style-src': false,
'style-src': mode === 'production',
},
},
);

正在加载...
取消
保存