@@ -607,9 +607,6 @@ function getEsBuildCommonOptions(options: NormalizedApplicationBuildOptions): Bu
607
607
}
608
608
}
609
609
610
- const minifySyntax = optimizationOptions . scripts ;
611
- const minifyIdentifiers = minifySyntax && allowMangle ;
612
-
613
610
return {
614
611
absWorkingDir : workspaceRoot ,
615
612
format : 'esm' ,
@@ -621,10 +618,9 @@ function getEsBuildCommonOptions(options: NormalizedApplicationBuildOptions): Bu
621
618
metafile : true ,
622
619
legalComments : options . extractLicenses ? 'none' : 'eof' ,
623
620
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 ,
628
624
pure : [ 'forwardRef' ] ,
629
625
outdir : workspaceRoot ,
630
626
outExtension : outExtension ? { '.js' : `.${ outExtension } ` } : undefined ,
@@ -641,7 +637,7 @@ function getEsBuildCommonOptions(options: NormalizedApplicationBuildOptions): Bu
641
637
// Only set to false when script optimizations are enabled. It should not be set to true because
642
638
// Angular turns `ngDevMode` into an object for development debugging purposes when not defined
643
639
// which a constant true value would break.
644
- ...( minifySyntax ? { 'ngDevMode' : 'false' } : undefined ) ,
640
+ ...( optimizationOptions . scripts ? { 'ngDevMode' : 'false' } : undefined ) ,
645
641
'ngJitMode' : jit ? 'true' : 'false' ,
646
642
'ngServerMode' : 'false' ,
647
643
'ngHmrMode' : options . templateUpdates ? 'true' : 'false' ,
0 commit comments