@@ -12,8 +12,7 @@ const uiComponentsResolver = {
1212 name : 'ui-components-resolver' ,
1313 /**
1414 * This plugin intercepts imports starting with '@node-core/ui-components' or '#ui/' and resolves them
15- * to the corresponding index.tsx file in the node_modules directory. If the index.tsx file
16- * doesn't exist, the resolution falls back to the default behavior.
15+ * to the corresponding index.tsx file first, then .tsx file if index doesn't exist.
1716 * @param {import('esbuild').PluginBuild } build
1817 */
1918 setup ( build ) {
@@ -29,12 +28,24 @@ const uiComponentsResolver = {
2928 '@node-core/ui-components/'
3029 ) ;
3130
32- // Resolve to index.tsx file
31+ // Try index.tsx first
3332 const indexPath = fileURLToPath (
3433 import . meta. resolve ( `${ normalizedPath } /index.tsx` )
3534 ) ;
35+ if ( existsSync ( indexPath ) ) {
36+ return { path : indexPath } ;
37+ }
38+
39+ // Try .tsx extension
40+ const directPath = fileURLToPath (
41+ import . meta. resolve ( `${ normalizedPath } .tsx` )
42+ ) ;
43+ if ( existsSync ( directPath ) ) {
44+ return { path : directPath } ;
45+ }
3646
37- return existsSync ( indexPath ) ? { path : indexPath } : undefined ;
47+ // Fall back to default resolution
48+ return undefined ;
3849 } ) ;
3950 } ,
4051} ;
@@ -51,7 +62,8 @@ export default async code => {
5162 resolveDir : ESBUILD_RESOLVE_DIR ,
5263 } ,
5364 bundle : true ,
54- minify : true ,
65+ minify : false ,
66+ sourcemap : 'inline' ,
5567 format : 'iife' ,
5668 target : 'es2020' ,
5769 platform : 'browser' ,
0 commit comments