inject meta csp based on production status

This commit is contained in:
Danny Skubak 2018-07-05 18:49:27 -04:00
parent 1700363968
commit 1a8436e26f
2 changed files with 6 additions and 3 deletions

View File

@ -4,7 +4,7 @@
<head>
<meta charset="utf-8">
<title>MyCrypto</title>
<meta http-equiv="Content-Security-Policy" content="content-security-policy: default-src 'none'; script-src 'self'; worker-src 'self' blob:; style-src 'self' 'unsafe-inline'; manifest-src 'self'; font-src 'self'; img-src 'self' data: https://shapeshift.io; connect-src *;" >
<meta http-equiv="Content-Security-Policy" content="<%= htmlWebpackPlugin.options.metaCsp %>" >
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="description" content="MyCrypto is a free, open-source interface for interacting with the blockchain.">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">

View File

@ -166,7 +166,10 @@ module.exports = function(opts = {}) {
twitter: {
site: config.twitter.creator,
creator: config.twitter.creator
}
},
metaCsp: config.isProduction
? "default-src 'none'; script-src 'self'; worker-src 'self' blob:; style-src 'self' 'unsafe-inline'; manifest-src 'self'; font-src 'self'; img-src 'self' data: https://shapeshift.io; connect-src *;"
: ""
}),
new CopyWebpackPlugin([
@ -283,7 +286,7 @@ module.exports = function(opts = {}) {
if (process.env.VSCODE_DEBUG) {
devtool = 'cheap-module-source-map';
} else {
devtool = 'cheap-module-eval-source-map';
devtool = 'cheap-source-map';
}
}