Skip to content

Commit aa44008

Browse files
committed
fix: exclude shim file from bundled dependency detection
When shims: true is enabled, tsdown injects ESM shims (__filename, __dirname) by importing from its own esm-shims.js. Since this file resides in node_modules/tsdown/, the dependency detection in generateBundle incorrectly flags tsdown itself as a bundled dependency and shows a confusing hint suggesting the user configure deps.onlyBundle. Skip the shimFile when iterating module IDs in the generateBundle handler so the shim import is not reported as a bundled dependency. Closes #907
1 parent 25510c5 commit aa44008

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/features/deps.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ export function DepsPlugin(
218218
if (chunk.type === 'asset') continue
219219

220220
for (const id of chunk.moduleIds) {
221+
if (id === shimFile) continue
221222
const parsed = await readBundledDepInfo(id)
222223
if (!parsed) continue
223224

0 commit comments

Comments
 (0)