Skip to content

Commit 8d42155

Browse files
committed
Specify the filename for worker-loader to avoid bundling workers
1 parent d684f7f commit 8d42155

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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?$/,

0 commit comments

Comments
 (0)