Skip to content

Commit 554e4be

Browse files
committed
Add crossorigin to default sandbox.html files
1 parent fc1f3dd commit 554e4be

File tree

4 files changed

+25
-2
lines changed

4 files changed

+25
-2
lines changed

packages/app/config/webpack.common.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const webpack = require('webpack');
33
const path = require('path');
44
const fs = require('fs');
55
const HtmlWebpackPlugin = require('html-webpack-plugin');
6+
const ScriptExtHtmlWebpackPlugin = require('script-ext-html-webpack-plugin');
67
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
78
const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin');
89
const threadLoader = require('thread-loader');
@@ -447,6 +448,13 @@ module.exports = {
447448
minifyURLs: true,
448449
},
449450
}),
451+
new ScriptExtHtmlWebpackPlugin({
452+
custom: {
453+
test: 'sandbox',
454+
attribute: 'crossorigin',
455+
value: 'anonymous',
456+
},
457+
}),
450458
]
451459
: [
452460
// Generates an `index.html` file with the <script> injected.
@@ -495,6 +503,13 @@ module.exports = {
495503
minifyURLs: true,
496504
},
497505
}),
506+
new ScriptExtHtmlWebpackPlugin({
507+
custom: {
508+
test: 'sandbox',
509+
attribute: 'crossorigin',
510+
value: 'anonymous',
511+
},
512+
}),
498513
new HtmlWebpackPlugin({
499514
inject: true,
500515
chunks: __PROD__

packages/app/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,7 @@
320320
"rimraf": "^2.6.1",
321321
"run-sequence": "^1.2.2",
322322
"sass-loader": "^7.1.0",
323+
"script-ext-html-webpack-plugin": "^2.1.4",
323324
"selenium-webdriver": "^4.0.0-alpha.1",
324325
"strip-ansi": "3.0.1",
325326
"style-loader": "^0.21.0",

packages/app/scripts/build.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@ function build(previousSizeMap) {
169169
// }
170170
// );
171171

172-
console.log(`Writing version '${version}' to version.txt`);
173-
fs.writeFile(paths.appBuild + '/version.txt', version);
172+
console.log(`Writing version '${version.default}' to version.txt`);
173+
fs.writeFileSync(paths.appBuild + '/version.txt', version.default);
174174
console.log();
175175

176176
let openCommand = process.platform === 'win32' ? 'start' : 'open';

yarn.lock

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25362,6 +25362,13 @@ screenfull@^4.1.0:
2536225362
resolved "https://registry.yarnpkg.com/screenfull/-/screenfull-4.2.0.tgz#d5252a5a0f56504719abbed9ebbcd9208115da03"
2536325363
integrity sha512-qpyI9XbwuMJElWRP5vTgxkFAl4k7HpyhIqBFOZEwX9QBXn0MAuRSpn7LOc6/4CeSwoz61oBu1VPV+2fbIWC+5Q==
2536425364

25365+
script-ext-html-webpack-plugin@^2.1.4:
25366+
version "2.1.4"
25367+
resolved "https://registry.yarnpkg.com/script-ext-html-webpack-plugin/-/script-ext-html-webpack-plugin-2.1.4.tgz#7c309354e310bf78523e1b84ca96fd374ceb9880"
25368+
integrity sha512-7MAv3paAMfh9y2Rg+yQKp9jEGC5cEcmdge4EomRqri10qoczmliYEVPVNz0/5e9QQ202e05qDll9B8zZlY9N1g==
25369+
dependencies:
25370+
debug "^4.1.1"
25371+
2536525372
scroll-behavior@^0.9.9:
2536625373
version "0.9.10"
2536725374
resolved "https://registry.yarnpkg.com/scroll-behavior/-/scroll-behavior-0.9.10.tgz#c8953adeeb3586060b903328d860aa8346d62861"

0 commit comments

Comments
 (0)