Explicitly set worker-loader's publicPath to webapp

pull/24154/head
Andy Balaam 2023-01-04 10:42:19 +00:00
parent c49e8ed76c
commit f5fea0be04
1 changed files with 9 additions and 0 deletions

View File

@ -236,6 +236,15 @@ module.exports = (env, argv) => {
{ {
test: /\.worker\.ts$/, test: /\.worker\.ts$/,
loader: "worker-loader", loader: "worker-loader",
options: {
// worker-loader v3 defaults to output.publicPath here,
// which causes worker.js to be included in the bundle
// in R2. This in turn causes CSP to fail when loading
// the worker.
// So, we explicitly ask to include it in the webapp
// dir.
publicPath: "webapp",
},
}, },
{ {
test: /\.(ts|js)x?$/, test: /\.(ts|js)x?$/,