Skip to content

Commit 502792a

Browse files
committed
Bundle internal code to resolve aliases at build time instead of runtime
1 parent 095fed7 commit 502792a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tsup.config.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,12 @@ export default defineConfig({
6161
splitting: false,
6262
sourcemap: false,
6363
bundle: true,
64-
// Don't bundle node_modules, keep them external
65-
// This regex matches any import that doesn't start with . or / or our aliases
64+
// Keep ONLY node_modules external (everything from node_modules)
6665
external: [
67-
/^(?!@(api|config|utils|cache|libs|validate|exceptions))[^.\/]/,
66+
/^(?!\.{1,2}\/)/, // Everything that doesn't start with ./ or ../
67+
],
68+
noExternal: [
69+
/^@(api|config|utils|cache|libs|validate|exceptions)/, // Bundle our own code
6870
],
6971
tsconfig: './tsconfig.json',
7072
esbuildPlugins: [pathResolverPlugin],

0 commit comments

Comments
 (0)