Skip to content

fix(pack): preserve non-array pack.plugins when dts is enabled - #3615

Open
CoderSerio wants to merge 1 commit into
voidzero-dev:mainfrom
CoderSerio:fix/pack-dts-non-array-plugins
Open

CoderSerio wants to merge 1 commit into
voidzero-dev:mainfrom
CoderSerio:fix/pack-dts-non-array-plugins

Conversation

@CoderSerio

Copy link
Copy Markdown

pack.plugins (TsdownPluginOption) accepts a single plugin object or a Promise in addition to an array of plugins. When dts was enabled, pack-bin.ts previously normalized merged.plugins with Array.isArray(merged.plugins) ? merged.plugins : [] before appending externalDtsTypeOnlyPlugin(), silently dropping valid non-array plugin values.

Preserve truthy non-array merged.plugins entries alongside externalDtsTypeOnlyPlugin() so tsdown's flattenPlugins() resolves single plugins and Promise plugin options consistently whether dts is enabled or not.

This branch has not been deployed

No deployments
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.

1 participant