From 7aacdff7237ff58ab541911d9ccb6f1284576004 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Fri, 13 Dec 2024 17:42:29 +0000 Subject: [PATCH] fix(rollup): de-default default export from stub (#455) --- src/builders/rollup/stub.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/builders/rollup/stub.ts b/src/builders/rollup/stub.ts index d9e54239..8fcdc217 100644 --- a/src/builders/rollup/stub.ts +++ b/src/builders/rollup/stub.ts @@ -144,7 +144,9 @@ export async function rollupStub(ctx: BuildContext): Promise { `const _module = await jiti.import(${JSON.stringify( resolvedEntry, )});`, - hasDefaultExport ? "\nexport default _module;" : "", + hasDefaultExport + ? "\nexport default _module?.default ?? _module;" + : "", ...namedExports .filter((name) => name !== "default") .map((name) => `export const ${name} = _module.${name};`),