diff --git a/src/builders/rollup/build.ts b/src/builders/rollup/build.ts index 3af01e6..f7c4988 100644 --- a/src/builders/rollup/build.ts +++ b/src/builders/rollup/build.ts @@ -82,7 +82,7 @@ export async function rollupBuild(ctx: BuildContext): Promise { ...rollupOptions.plugins, dts(ctx.options.rollup.dts), removeShebangPlugin(), - ctx.options.rollup.emitCJS && fixCJSExportTypePlugin() + ctx.options.rollup.emitCJS && fixCJSExportTypePlugin(), ].filter(Boolean); await ctx.hooks.callHook("rollup:dts:options", ctx, rollupOptions); diff --git a/src/builders/rollup/plugins/cjs.ts b/src/builders/rollup/plugins/cjs.ts index b487c47..5edfa5b 100644 --- a/src/builders/rollup/plugins/cjs.ts +++ b/src/builders/rollup/plugins/cjs.ts @@ -21,7 +21,7 @@ export function fixCJSExportTypePlugin(): Plugin { renderChunk(code, info, opts) { if ( info.type !== "chunk" || - !info.fileName.endsWith('.d.cts') || + !info.fileName.endsWith(".d.cts") || !info.isEntry || info.exports?.length !== 1 || info.exports[0] !== "default"