Skip to content

Commit 8940ca2

Browse files
author
Tajudeen
committed
fix: use explicit paths in external array for React outputs
- Replace function matcher with explicit string paths (tsup doesn't support functions) - List all React output import paths explicitly in external array - This ensures tsup marks them as external during its resolution phase - Fixes 'Could not resolve' errors during React build
1 parent 9ce1c98 commit 8940ca2

1 file changed

Lines changed: 18 additions & 6 deletions

File tree

‎src/vs/workbench/contrib/cortexide/browser/react/tsup.config.js‎

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,24 @@ export default defineConfig({
7272
// 4. If not in external array, tsup tries to resolve files that don't exist yet → fails
7373
external: [
7474
'url', 'module', 'fs', 'path', 'os', 'crypto', 'stream', 'util', 'events', 'buffer', 'process',
75-
// React output imports - must be external at tsup level to prevent resolution errors
76-
// Using function to match both ./react/out/ and ../react/out/ patterns
77-
// tsup checks this during its own resolution phase (before esbuild)
78-
(id) => {
79-
return id.startsWith('./react/out/') || id.startsWith('../react/out/')
80-
},
75+
// React output imports - MUST be external at tsup level to prevent resolution errors
76+
// tsup checks external array during its own resolution phase (before esbuild)
77+
// If not listed here, tsup tries to resolve files that don't exist yet → fails
78+
// These are the exact paths used in imports from files outside React directory
79+
'./react/out/void-editor-widgets-tsx/index.js',
80+
'./react/out/void-settings-tsx/index.js',
81+
'./react/out/sidebar-tsx/index.js',
82+
'./react/out/void-tooltip/index.js',
83+
'./react/out/void-onboarding/index.js',
84+
'./react/out/quick-edit-tsx/index.js',
85+
'./react/out/diff/index.js',
86+
'../react/out/void-editor-widgets-tsx/index.js',
87+
'../react/out/void-settings-tsx/index.js',
88+
'../react/out/sidebar-tsx/index.js',
89+
'../react/out/void-tooltip/index.js',
90+
'../react/out/void-onboarding/index.js',
91+
'../react/out/quick-edit-tsx/index.js',
92+
'../react/out/diff/index.js',
8193
],
8294
// Use tsconfig.json which has ignoreDeprecations: "6.0" to suppress baseUrl deprecation warnings
8395
tsconfig: './tsconfig.json',

0 commit comments

Comments
 (0)