Skip to content

Commit f5fea0b

Browse files
committed
Explicitly set worker-loader's publicPath to webapp
1 parent c49e8ed commit f5fea0b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

webpack.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,15 @@ module.exports = (env, argv) => {
236236
{
237237
test: /\.worker\.ts$/,
238238
loader: "worker-loader",
239+
options: {
240+
// worker-loader v3 defaults to output.publicPath here,
241+
// which causes worker.js to be included in the bundle
242+
// in R2. This in turn causes CSP to fail when loading
243+
// the worker.
244+
// So, we explicitly ask to include it in the webapp
245+
// dir.
246+
publicPath: "webapp",
247+
},
239248
},
240249
{
241250
test: /\.(ts|js)x?$/,

0 commit comments

Comments
 (0)