@@ -37,9 +37,6 @@ export interface BundleEntryPointsOutput {
3737
3838 /** Warning messages emitted during bundling. */
3939 warnings : string [ ] ;
40-
41- /** Error messages emitted during bundling. */
42- errors : string [ ] ;
4340}
4441
4542/**
@@ -74,9 +71,6 @@ interface MultiBundleOutput {
7471
7572 /** Warning messages emitted during the bundle invocation. */
7673 warnings : string [ ] ;
77-
78- /** Error messages emitted during the bundle invocation. */
79- errors : string [ ] ;
8074}
8175
8276/**
@@ -97,7 +91,7 @@ export async function bundleEntryPoints(
9791) : Promise < BundleEntryPointsOutput > {
9892 const bundleResults = new Map < string , BundleResult > ( ) ;
9993 if ( items . length === 0 ) {
100- return { filesToEmit : [ ] , bundleResults, warnings : [ ] , errors : [ ] } ;
94+ return { filesToEmit : [ ] , bundleResults, warnings : [ ] } ;
10195 }
10296
10397 const esmEntryPoints : NormalizedEntryPoint [ ] = [ ] ;
@@ -135,7 +129,6 @@ export async function bundleEntryPoints(
135129 filesToEmit : [ ...esmOutput . filesToEmit , ...dtsOutput . filesToEmit ] ,
136130 bundleResults,
137131 warnings : [ ...esmOutput . warnings , ...dtsOutput . warnings ] ,
138- errors : [ ...esmOutput . errors , ...dtsOutput . errors ] ,
139132 } ;
140133}
141134
@@ -324,27 +317,24 @@ async function executeMultiBundle(
324317 const isDts = extension === 'd.ts' ;
325318 const dir = isDts ? TYPES_OUTPUT_DIR : FESM_OUTPUT_DIR ;
326319 const warnings : string [ ] = [ ] ;
327- const errors : string [ ] = [ ] ;
328- let bundle : Awaited < ReturnType < typeof rolldown > > | undefined ;
320+ const bundle = await rolldown ( {
321+ context : 'this' ,
322+ input,
323+ plugins,
324+ treeshake : false ,
325+ resolve : { symlinks : ! preserveSymlinks } ,
326+ checks : { circularDependency : false } ,
327+ onLog ( level , log ) {
328+ if ( level === 'warn' ) {
329+ warnings . push ( log . message ) ;
330+ }
331+ } ,
332+ experimental : {
333+ attachDebugInfo : 'none' ,
334+ } ,
335+ } ) ;
329336
330337 try {
331- bundle = await rolldown ( {
332- context : 'this' ,
333- input,
334- plugins,
335- treeshake : false ,
336- resolve : { symlinks : ! preserveSymlinks } ,
337- checks : { circularDependency : false } ,
338- onLog ( level , log ) {
339- if ( level === 'warn' ) {
340- warnings . push ( log . message ) ;
341- }
342- } ,
343- experimental : {
344- attachDebugInfo : 'none' ,
345- } ,
346- } ) ;
347-
348338 const { output } = await bundle . generate ( {
349339 format : 'es' ,
350340 dir,
@@ -355,25 +345,12 @@ async function executeMultiBundle(
355345 comments : { jsdoc : isDts , legal : true , annotation : true } ,
356346 } ) ;
357347
358- const { filesToEmit, moduleIdsByBundle } = processRolldownOutput ( output , dir ) ;
359-
360- return {
361- filesToEmit,
362- moduleIdsByBundle,
363- warnings,
364- errors,
365- } ;
366- } catch ( error ) {
367- errors . push ( error instanceof Error ? error . message : String ( error ) ) ;
368-
369348 return {
370- filesToEmit : [ ] ,
371- moduleIdsByBundle : new Map ( ) ,
349+ ...processRolldownOutput ( output , dir ) ,
372350 warnings,
373- errors,
374351 } ;
375352 } finally {
376- await bundle ? .close ( ) ;
353+ await bundle . close ( ) ;
377354 }
378355}
379356
@@ -391,7 +368,7 @@ async function bundleAllEsm(
391368 options : NormalizedLibraryOptions ,
392369) : Promise < MultiBundleOutput > {
393370 if ( entryPoints . length === 0 ) {
394- return { filesToEmit : [ ] , moduleIdsByBundle : new Map ( ) , warnings : [ ] , errors : [ ] } ;
371+ return { filesToEmit : [ ] , moduleIdsByBundle : new Map ( ) , warnings : [ ] } ;
395372 }
396373
397374 return executeMultiBundle (
@@ -417,7 +394,7 @@ async function bundleAllDts(
417394 options : NormalizedLibraryOptions ,
418395) : Promise < MultiBundleOutput > {
419396 if ( entryPoints . length === 0 ) {
420- return { filesToEmit : [ ] , moduleIdsByBundle : new Map ( ) , warnings : [ ] , errors : [ ] } ;
397+ return { filesToEmit : [ ] , moduleIdsByBundle : new Map ( ) , warnings : [ ] } ;
421398 }
422399
423400 const dtsSourcemap = options . declarationMap ;
0 commit comments