Reproduction link or steps
https://stackblitz.com/edit/github-z3jerszh?file=vite.config.ts (pnpm build + pnpm preview)
What is expected?
Production build shouldn't crash and work like the development build.
What is actually happening?
It crashes due to some import issue.
System Info
Any additional comments?
// Input:
const library = (await import("compromise")).default;
// Output:
const library = (
await __vitePreload(
async () => {
const { __vite_default__ } = await import("./three.CfgmKlHw.js");
return { __vite_default__ };
},
__vite__mapDeps([0, 1, 2]),
import.meta.url
)
).default;
// Input (workaround):
const importedLibrary = await import("compromise");
const library = importedLibrary.default;
// Output:
const importedLibrary = await import("./three.C2fRUMY_.js");
const library = importedLibrary.default;