Skip to content

Commit ba0099a

Browse files
authored
fix(build): transpile import.meta in outputs (#2083)
1 parent a202067 commit ba0099a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

packages/core/tsdown.config.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,17 @@ export default defineConfig({
1414
sourcemap: true,
1515
hash: false,
1616

17+
/**
18+
* Quick fix for tsdown not convert "import.meta" for non-esm output.
19+
* When tsdown resolves the issue, this can be removed.
20+
*
21+
* @see https://github.com/rolldown/tsdown/issues/370
22+
*/
23+
define: {
24+
'import.meta.env.DEV': 'undefined',
25+
'import.meta.env.MODE': 'undefined',
26+
},
27+
1728
inputOptions: {
1829
preserveEntrySignatures: 'allow-extension',
1930
experimental: {

0 commit comments

Comments
 (0)