@@ -411,15 +411,57 @@ export default async () => {
411411 } ) ,
412412 // Bundle external wrapper modules separately
413413 // Each external module gets its own self-contained bundle
414- // Note: Using the base configuration to handle these properly
414+ // Bundle each one individually to avoid code splitting
415415 baseConfig ( {
416- input : {
417- 'external/ink-table' : `${ srcPath } /external/ink-table.mjs` ,
418- 'external/yoga-layout' : `${ srcPath } /external/yoga-layout.mjs` ,
416+ input : `${ srcPath } /external/ink.mjs` ,
417+ output : {
418+ file : path . join ( path . relative ( rootPath , distPath ) , 'external/ink.js' ) ,
419+ format : 'cjs' ,
420+ exports : 'auto' ,
421+ externalLiveBindings : false ,
422+ generatedCode : {
423+ preset : 'es2015' ,
424+ arrowFunctions : true ,
425+ constBindings : true ,
426+ objectShorthand : true
427+ } ,
428+ compact : true ,
429+ sourcemap : false ,
430+ inlineDynamicImports : true ,
431+ } ,
432+ // Override external to bundle dependencies for these modules
433+ external ( id ) {
434+ // Only externalize Node.js built-ins
435+ return isBuiltin ( id )
436+ } ,
437+ } ) ,
438+ baseConfig ( {
439+ input : `${ srcPath } /external/ink-table.mjs` ,
440+ output : {
441+ file : path . join ( path . relative ( rootPath , distPath ) , 'external/ink-table.js' ) ,
442+ format : 'cjs' ,
443+ exports : 'auto' ,
444+ externalLiveBindings : false ,
445+ generatedCode : {
446+ preset : 'es2015' ,
447+ arrowFunctions : true ,
448+ constBindings : true ,
449+ objectShorthand : true
450+ } ,
451+ compact : true ,
452+ sourcemap : false ,
453+ inlineDynamicImports : true ,
454+ } ,
455+ // Override external to bundle dependencies for these modules
456+ external ( id ) {
457+ // Only externalize Node.js built-ins
458+ return isBuiltin ( id )
419459 } ,
460+ } ) ,
461+ baseConfig ( {
462+ input : `${ srcPath } /external/yoga-layout.mjs` ,
420463 output : {
421- dir : path . relative ( rootPath , distPath ) ,
422- entryFileNames : '[name].js' ,
464+ file : path . join ( path . relative ( rootPath , distPath ) , 'external/yoga-layout.js' ) ,
423465 format : 'cjs' ,
424466 exports : 'auto' ,
425467 externalLiveBindings : false ,
@@ -431,6 +473,7 @@ export default async () => {
431473 } ,
432474 compact : true ,
433475 sourcemap : false ,
476+ inlineDynamicImports : true ,
434477 } ,
435478 // Override external to bundle dependencies for these modules
436479 external ( id ) {
0 commit comments