Specify the filename for worker-loader to avoid bundling workers

pull/24159/head
Andy Balaam 2023-01-04 13:36:18 +00:00
parent d684f7f336
commit 8d4215557a
1 changed files with 5 additions and 0 deletions

View File

@ -236,6 +236,11 @@ module.exports = (env, argv) => {
{ {
test: /\.worker\.ts$/, test: /\.worker\.ts$/,
loader: "worker-loader", loader: "worker-loader",
options: {
// Prevent bundling workers since CSP forbids loading them
// from another origin.
filename: "[hash].worker.js",
},
}, },
{ {
test: /\.(ts|js)x?$/, test: /\.(ts|js)x?$/,