diff --git a/webpack.config.js b/webpack.config.js index dce54b53f3..4b56ce27aa 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -236,6 +236,15 @@ module.exports = (env, argv) => { { test: /\.worker\.ts$/, 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?$/,