File tree Expand file tree Collapse file tree
playground/tsconfig-json-load-error/__tests__ Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -544,7 +544,7 @@ export async function build(
544544 } ,
545545 }
546546
547- const outputBuildError = ( e : RollupError ) => {
547+ const mergeRollupError = ( e : RollupError ) => {
548548 let msg = colors . red ( ( e . plugin ? `[${ e . plugin } ] ` : '' ) + e . message )
549549 if ( e . id ) {
550550 msg += `\nfile: ${ colors . cyan (
@@ -554,6 +554,11 @@ export async function build(
554554 if ( e . frame ) {
555555 msg += `\n` + colors . yellow ( e . frame )
556556 }
557+ return msg
558+ }
559+
560+ const outputBuildError = ( e : RollupError ) => {
561+ const msg = mergeRollupError ( e )
557562 clearLine ( )
558563 config . logger . error ( msg , { error : e } )
559564 }
@@ -704,7 +709,8 @@ export async function build(
704709 }
705710 return Array . isArray ( outputs ) ? res : res [ 0 ]
706711 } catch ( e ) {
707- outputBuildError ( e )
712+ e . message = mergeRollupError ( e )
713+ clearLine ( )
708714 throw e
709715 } finally {
710716 if ( bundle ) await bundle . close ( )
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import {
1111} from '~utils'
1212
1313const unexpectedTokenSyntaxErrorRE =
14- / ^ p a r s i n g .* f a i l e d : S y n t a x E r r o r : U n e x p e c t e d t o k e n .* \} .* /
14+ / ( \[ v i t e : e s b u i l d \] ) * p a r s i n g .* f a i l e d : S y n t a x E r r o r : U n e x p e c t e d t o k e n .* \} .* /
1515
1616describe . runIf ( isBuild ) ( 'build' , ( ) => {
1717 test ( 'should throw an error on build' , ( ) => {
You can’t perform that action at this time.
0 commit comments