@@ -607,9 +607,6 @@ function getEsBuildCommonOptions(options: NormalizedApplicationBuildOptions): Bu
607607 }
608608 }
609609
610- const minifySyntax = optimizationOptions . scripts ;
611- const minifyIdentifiers = minifySyntax && allowMangle ;
612-
613610 return {
614611 absWorkingDir : workspaceRoot ,
615612 format : 'esm' ,
@@ -621,10 +618,9 @@ function getEsBuildCommonOptions(options: NormalizedApplicationBuildOptions): Bu
621618 metafile : true ,
622619 legalComments : options . extractLicenses ? 'none' : 'eof' ,
623620 logLevel : options . verbose && ! jsonLogs ? 'debug' : 'silent' ,
624- keepNames : ! minifyIdentifiers ,
625- minifyIdentifiers,
626- minifySyntax,
627- minifyWhitespace : minifySyntax ,
621+ minifyIdentifiers : optimizationOptions . scripts && allowMangle ,
622+ minifySyntax : optimizationOptions . scripts ,
623+ minifyWhitespace : optimizationOptions . scripts ,
628624 pure : [ 'forwardRef' ] ,
629625 outdir : workspaceRoot ,
630626 outExtension : outExtension ? { '.js' : `.${ outExtension } ` } : undefined ,
@@ -641,7 +637,7 @@ function getEsBuildCommonOptions(options: NormalizedApplicationBuildOptions): Bu
641637 // Only set to false when script optimizations are enabled. It should not be set to true because
642638 // Angular turns `ngDevMode` into an object for development debugging purposes when not defined
643639 // which a constant true value would break.
644- ...( minifySyntax ? { 'ngDevMode' : 'false' } : undefined ) ,
640+ ...( optimizationOptions . scripts ? { 'ngDevMode' : 'false' } : undefined ) ,
645641 'ngJitMode' : jit ? 'true' : 'false' ,
646642 'ngServerMode' : 'false' ,
647643 'ngHmrMode' : options . templateUpdates ? 'true' : 'false' ,
0 commit comments