Visitar URL original
fix: respect explicit rolldown external · sxzz/rolldown-plugin-dts@03998d4 · GitHub
Skip to content

Commit 03998d4

Browse files
committed
fix: respect explicit rolldown external
1 parent 1ded2c1 commit 03998d4

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎src/resolver.ts‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ export function createDtsResolvePlugin({
6969
importer,
7070
rolldownResolution,
7171
)
72+
if (rolldownResolution?.external) {
73+
debug('Rolldown marked dts import as external:', id)
74+
return external
75+
}
76+
7277
const dtsResolution = await resolveDtsPath(
7378
id,
7479
importer,
@@ -97,7 +102,7 @@ export function createDtsResolvePlugin({
97102
// User doesn't want to bundle this module
98103
!shouldBundleNodeModule(id) &&
99104
// The importer is not in node_modules, or if it is, the module is marked as external by Rolldown
100-
(!RE_NODE_MODULES.test(importer) || rolldownResolution?.external)
105+
!RE_NODE_MODULES.test(importer)
101106
) {
102107
debug('Externalizing node_modules dts import:', id)
103108
return external

0 commit comments

Comments
 (0)