Bläddra i källkod

Re-enables CSP for production

main
Eric Amodio 2 år sedan
förälder
incheckning
1dc14411c6
1 ändrade filer med 6 tillägg och 3 borttagningar
  1. +6
    -3
      webpack.config.js

+ 6
- 3
webpack.config.js Visa fil

@ -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',
},
},
);

Laddar…
Avbryt
Spara