File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed
packages/vite/src/node/plugins Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -323,8 +323,6 @@ export function importAnalysisPlugin(config: ResolvedConfig): Plugin {
323323 pos : number ,
324324 forceSkipImportAnalysis : boolean = false ,
325325 ) : Promise < [ string , string | null ] > => {
326- url = stripBase ( url , base )
327-
328326 let importerFile = importer
329327
330328 if (
Original file line number Diff line number Diff line change @@ -451,13 +451,14 @@ export function webWorkerPlugin(config: ResolvedConfig): Plugin {
451451 const workerType = workerFileMatch [ 1 ] as WorkerType
452452 let injectEnv = ''
453453
454- const scriptPath = JSON . stringify (
455- path . posix . join ( config . base , ENV_PUBLIC_PATH ) ,
456- )
457-
458454 if ( workerType === 'classic' ) {
455+ // base needs to be joined as the base is not injected to `importScripts` automatically
456+ const scriptPath = JSON . stringify (
457+ path . posix . join ( config . base , ENV_PUBLIC_PATH ) ,
458+ )
459459 injectEnv = `importScripts(${ scriptPath } )\n`
460460 } else if ( workerType === 'module' ) {
461+ const scriptPath = JSON . stringify ( ENV_PUBLIC_PATH )
461462 injectEnv = `import ${ scriptPath } \n`
462463 } else if ( workerType === 'ignore' ) {
463464 if ( isBuild ) {
You can’t perform that action at this time.
0 commit comments