| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 5a9503b commit 5d46d6e
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -607,6 +607,9 @@ function getEsBuildCommonOptions(options: NormalizedApplicationBuildOptions): Bu | |||
| 607 | 607 | } | |
| 608 | 608 | } | |
| 609 | 609 | ||
| 610 | + const minifySyntax = optimizationOptions.scripts; | ||
| 611 | + const minifyIdentifiers = minifySyntax && allowMangle; | ||
| 612 | + | ||
| 610 | 613 | return { | |
| 611 | 614 | absWorkingDir: workspaceRoot, | |
| 612 | 615 | format: 'esm', | |
@@ -618,9 +621,10 @@ function getEsBuildCommonOptions(options: NormalizedApplicationBuildOptions): Bu | |||
| 618 | 621 | metafile: true, | |
| 619 | 622 | legalComments: options.extractLicenses ? 'none' : 'eof', | |
| 620 | 623 | logLevel: options.verbose && !jsonLogs ? 'debug' : 'silent', | |
| 621 | - minifyIdentifiers: optimizationOptions.scripts && allowMangle, | ||
| 622 | - minifySyntax: optimizationOptions.scripts, | ||
| 623 | - minifyWhitespace: optimizationOptions.scripts, | ||
| 624 | + keepNames: !minifyIdentifiers, | ||
| 625 | + minifyIdentifiers, | ||
| 626 | + minifySyntax, | ||
| 627 | + minifyWhitespace: minifySyntax, | ||
| 624 | 628 | pure: ['forwardRef'], | |
| 625 | 629 | outdir: workspaceRoot, | |
| 626 | 630 | outExtension: outExtension ? { '.js': `.${outExtension}` } : undefined, | |
@@ -637,7 +641,7 @@ function getEsBuildCommonOptions(options: NormalizedApplicationBuildOptions): Bu | |||
| 637 | 641 | // Only set to false when script optimizations are enabled. It should not be set to true because | |
| 638 | 642 | // Angular turns `ngDevMode` into an object for development debugging purposes when not defined | |
| 639 | 643 | // which a constant true value would break. | |
| 640 | - ...(optimizationOptions.scripts ? { 'ngDevMode': 'false' } : undefined), | ||
| 644 | + ...(minifySyntax ? { 'ngDevMode': 'false' } : undefined), | ||
| 641 | 645 | 'ngJitMode': jit ? 'true' : 'false', | |
| 642 | 646 | 'ngServerMode': 'false', | |
| 643 | 647 | 'ngHmrMode': options.templateUpdates ? 'true' : 'false', | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -98,6 +98,7 @@ export function getDepOptimizationConfig({ | |||
| 98 | 98 | esbuildOptions: { | |
| 99 | 99 | // Set esbuild supported targets. | |
| 100 | 100 | target, | |
| 101 | + keepNames: true, | ||
| 101 | 102 | supported: getFeatureSupport(target, zoneless), | |
| 102 | 103 | plugins, | |
| 103 | 104 | loader, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -48,6 +48,6 @@ export default async function () { | |||
| 48 | 48 | message, | |
| 49 | 49 | // When babel is used it will add names to the sourcemap and `constructor` will be used in the stack trace. | |
| 50 | 50 | // This will currently only happen if AOT and script optimizations are set which enables advanced optimizations. | |
| 51 | - /window is not defined[.\s\S]*(?:constructor|_App) \(.*app\.ts\:\d+:\d+\)/, | ||
| 51 | + /window is not defined[.\s\S]*(?:constructor|App) \(.*app\.ts\:\d+:\d+\)/, | ||
| 52 | 52 | ); | |
| 53 | 53 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments