Skip to content

Commit 30601bb

Browse files
authored
Merge pull request #71 from ServerlessLife/fix/tsdown-shim-does-not-work
fix: tsdown shim for dirname is not correct, adding custom shim via banner instead
2 parents 42949be + 42f4d1a commit 30601bb

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)