Skip to content

Commit 42f4d1a

Browse files
committed
fix: tsdown shim for dirname is not correct, adding custom shim via banner instead
1 parent 42949be commit 42f4d1a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tsdown.config.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,10 @@ export default defineConfig({
1212
'functions/**/*.ts',
1313
],
1414
unbundle: true,
15-
shims: true,
15+
outputOptions: {
16+
banner: (chunk) =>
17+
chunk.fileName.endsWith('.mjs')
18+
? 'const __dirname = import.meta.dirname;'
19+
: '',
20+
},
1621
});

0 commit comments

Comments
 (0)