From 8d4215557afe8fab81c763322a3f6ec58b3977a4 Mon Sep 17 00:00:00 2001 From: Andy Balaam Date: Wed, 4 Jan 2023 13:36:18 +0000 Subject: [PATCH] Specify the filename for worker-loader to avoid bundling workers --- webpack.config.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/webpack.config.js b/webpack.config.js index dce54b53f3..0840451c59 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -236,6 +236,11 @@ module.exports = (env, argv) => { { test: /\.worker\.ts$/, loader: "worker-loader", + options: { + // Prevent bundling workers since CSP forbids loading them + // from another origin. + filename: "[hash].worker.js", + }, }, { test: /\.(ts|js)x?$/,