Skip to content

Commit

Permalink
fix(rollup): de-default default export from stub (#455)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe authored Dec 13, 2024
1 parent 577b841 commit 7aacdff
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/builders/rollup/stub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@ export async function rollupStub(ctx: BuildContext): Promise<void> {
`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};`),
Expand Down

0 comments on commit 7aacdff

Please sign in to comment.