Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add dts options: respectExternal #827

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ export type DtsConfig = {
* This option takes higher priority than `compilerOptions` in tsconfig.json
*/
compilerOptions?: any
/**
* The dts plugin will by default flag *all* external libraries as `external`,
* and thus prevent them from be bundled.
* If you set the `respectExternal` option to `true`, the plugin will not do
* any default classification, but rather use the `external` option as
* configured via rollup.
* @link https://github.com/Swatinem/rollup-plugin-dts/blob/03a8728db66648e68d59497e1c05bb38cf4ff3a9/src/index.ts#L17
*/
respectExternal?: boolean;
}

export type BannerOrFooter =
Expand Down
1 change: 1 addition & 0 deletions src/rollup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ const getRollupConfig = async (
jsonPlugin(),
ignoreFiles,
dtsPlugin.default({
respectExternal: dtsOptions.respectExternal,
tsconfig: options.tsconfig,
compilerOptions: {
...compilerOptions,
Expand Down
Loading