Skip to content

Commit

Permalink
Explicitly set worker-loader's publicPath to webapp
Browse files Browse the repository at this point in the history
  • Loading branch information
andybalaam committed Jan 4, 2023
1 parent c49e8ed commit f5fea0b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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?$/,
Expand Down

0 comments on commit f5fea0b

Please sign in to comment.