Skip to content

Commit

Permalink
fix: Fix web worker not working
Browse files Browse the repository at this point in the history
  • Loading branch information
Wxh16144 committed Dec 25, 2024
1 parent 80794bd commit 8d2a37c
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type {
Compiler,
Compilation,
Compiler,
RuntimeModule,
} from '@umijs/bundler-webpack/compiled/webpack';

Expand All @@ -24,7 +24,9 @@ export class RuntimePublicPathPlugin {
)
return;
// @ts-ignore
module._cachedGeneratedCode = `__webpack_require__.p = (typeof globalThis !== 'undefined' ? globalThis : window).publicPath || '/';`;
module._cachedGeneratedCode = `__webpack_require__.p = (typeof globalThis !== 'undefined' ? globalThis : window).publicPath || ${
compilation.outputOptions.publicPath ?? '/'
};`;
}
},
);
Expand Down

0 comments on commit 8d2a37c

Please sign in to comment.