Skip to content

fix: filter commonjs plugin when generating declaration#495

Merged
pi0 merged 2 commits into
unjs:mainfrom
kricsleo:fix/commonjs-conflicts-with-dts
Feb 26, 2025
Merged

fix: filter commonjs plugin when generating declaration#495
pi0 merged 2 commits into
unjs:mainfrom
kricsleo:fix/commonjs-conflicts-with-dts

Conversation

@kricsleo

@kricsleo kricsleo commented Jan 26, 2025

Copy link
Copy Markdown
Member

resolves #396
resolves #135

The rollup-plugin-dts conflicts with @rollup/plugin-commonjs:

The plugin does its own import resolution through the typescript compiler, and usage together with other resolution plugins, such as node-resolve can lead to errors and is not recommended.
rollup-plugin-dts - what-to-expect

I'm not sure if it's okay to simply remove @rollup/plugin-commonjs when generating declarations. 🤔
I've tested some common cases, and it's working fine.

Comment thread src/builders/rollup/build.ts
@pi0 pi0 merged commit c915342 into unjs:main Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

commonjs plugin should not include .ts extension Commonjs plugin is run on typescript definition files

2 participants