Skip to content

Commit

Permalink
fix(worker): fixed public path in worker when __webpack_public_path__…
Browse files Browse the repository at this point in the history
… is empty string
  • Loading branch information
Kirill Kharitonov committed Mar 11, 2024
1 parent efe372f commit d1fe737
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/common/webpack/worker/web-worker.mts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export {WebWorker as Worker, SharedWebWorker as SharedWorker};

function generateWorkerLoader(url: string | URL) {
// eslint-disable-next-line camelcase
const publicPath = __webpack_public_path__;
const publicPath = __webpack_public_path__ === '' ? '/' : __webpack_public_path__;
const workerPublicPath = publicPath.match(/^https?:\/\//)
? publicPath
: new URL(publicPath, window.location.href).toString();
Expand Down

0 comments on commit d1fe737

Please sign in to comment.