Skip to content

Commit 6ff0524

Browse files
authored
Merge pull request #24159 from andybalaam/andybalaam/allow-upgrading-worker-loader-to-v3
Upgrade worker loader to v3 (with config fix to prevent bundling)
2 parents 411b40a + 8d42155 commit 6ff0524

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@
166166
"webpack": "^4.46.0",
167167
"webpack-cli": "^3.3.12",
168168
"webpack-dev-server": "^3.11.2",
169-
"worker-loader": "^2.0.0",
169+
"worker-loader": "^3.0.0",
170170
"worklet-loader": "^2.0.0",
171171
"yaml": "^2.0.1"
172172
},

webpack.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,11 @@ module.exports = (env, argv) => {
236236
{
237237
test: /\.worker\.ts$/,
238238
loader: "worker-loader",
239+
options: {
240+
// Prevent bundling workers since CSP forbids loading them
241+
// from another origin.
242+
filename: "[hash].worker.js",
243+
},
239244
},
240245
{
241246
test: /\.(ts|js)x?$/,

yarn.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12695,13 +12695,13 @@ worker-farm@^1.7.0:
1269512695
dependencies:
1269612696
errno "~0.1.7"
1269712697

12698-
worker-loader@^2.0.0:
12699-
version "2.0.0"
12700-
resolved "https://registry.yarnpkg.com/worker-loader/-/worker-loader-2.0.0.tgz#45fda3ef76aca815771a89107399ee4119b430ac"
12701-
integrity sha512-tnvNp4K3KQOpfRnD20m8xltE3eWh89Ye+5oj7wXEEHKac1P4oZ6p9oTj8/8ExqoSBnk9nu5Pr4nKfQ1hn2APJw==
12698+
worker-loader@^3.0.0:
12699+
version "3.0.8"
12700+
resolved "https://registry.yarnpkg.com/worker-loader/-/worker-loader-3.0.8.tgz#5fc5cda4a3d3163d9c274a4e3a811ce8b60dbb37"
12701+
integrity sha512-XQyQkIFeRVC7f7uRhFdNMe/iJOdO6zxAaR3EWbDp45v3mDhrTi+++oswKNxShUNjPC/1xUp5DB29YKLhFo129g==
1270212702
dependencies:
12703-
loader-utils "^1.0.0"
12704-
schema-utils "^0.4.0"
12703+
loader-utils "^2.0.0"
12704+
schema-utils "^3.0.0"
1270512705

1270612706
worklet-loader@^2.0.0:
1270712707
version "2.0.0"

0 commit comments

Comments
 (0)