import type * as esbuild from 'esbuild' ; /**
 * Causes esbuild to exit immediately with an error code.
 */ export const onErrorPlugin = { name : 'onErrorPlugin' , setup ( build ) { build . onEnd ( ( result ) => { if ( result . errors . length > 0 ) { if ( process . env . WATCH !== 'true' ) { process . exit ( 1 ) ; } } } ) ; } , } ;