Skip to content

Commit

Permalink
fix: filter commonjs plugin when generating declaration (#495)
Browse files Browse the repository at this point in the history
  • Loading branch information
kricsleo authored Feb 26, 2025
1 parent 74af8d0 commit c915342
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/builders/rollup/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,15 @@ export async function rollupBuild(ctx: BuildContext): Promise<void> {
dts(ctx.options.rollup.dts),
removeShebangPlugin(),
ctx.options.rollup.emitCJS && fixCJSExportTypePlugin(),
].filter(Boolean);
].filter(
(plugin) =>
/**
* Issue: #396
* rollup-plugin-dts conflicts with rollup-plugin-commonjs:
* https://github.com/Swatinem/rollup-plugin-dts?tab=readme-ov-file#what-to-expect
*/
plugin && (!("name" in plugin) || plugin.name !== "commonjs"),
);

await ctx.hooks.callHook("rollup:dts:options", ctx, rollupOptions);
const typesBuild = await rollup(rollupOptions);
Expand Down

0 comments on commit c915342

Please sign in to comment.