diff --git a/packages/web-worker/src/webpack-parts/loader.ts b/packages/web-worker/src/webpack-parts/loader.ts index 83f33915ef..fadd4ba38c 100644 --- a/packages/web-worker/src/webpack-parts/loader.ts +++ b/packages/web-worker/src/webpack-parts/loader.ts @@ -78,11 +78,11 @@ export function pitch(this: LoaderContext, request: string) { wrapperContent = cachedContent; } else if (cachedContent == null) { try { - if (this.fs?.readFileSync) { + if (this.fs?.readFileSync) { wrapperContent = this.fs.readFileSync(wrapperModule).toString(); moduleWrapperCache.set(wrapperModule, wrapperContent ?? false); } else { - throw new Error("readFileSync is undefined"); + throw new Error('readFileSync is undefined'); } } catch (error) { moduleWrapperCache.set(wrapperModule, false); @@ -90,7 +90,6 @@ export function pitch(this: LoaderContext, request: string) { } } - if (wrapperContent) { plugin.virtualModules.writeModule( virtualModule,