-
Notifications
You must be signed in to change notification settings - Fork 12k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide an ability to perform tree-shaking but retain symbol names #22354
Comments
What myself and @AndrewKushnir observed was that using
|
I use this to test non-mangled production output:
As I recall I arrived at that by reviewing the code that handles the different flags. Does that suffer from the same problem? |
@johncrim, yeah since in that case mangled is disabled. At least in v13, you can verify this by looking for |
…etain symbol names Previously, we enabled the `keepNames` esbuild when mangling was disabled, this caused dead code to be retained because of the transformations that esbuild did to the input. Input ```js class foo {} ``` Output ```js var l = Object.defineProperty, a = (s, c) => l(s, "name", { value: c, configurable: !0 }); class foo {} a(foo, "foo"); ``` Previously we enabled the `keepNames` esbuild option when mangling was disabled, which is actually not needed to retain the name of symbols but is needed for SSR because Domino relies on the `name` property on functions and classes. Closes #22354
…etain symbol names Previously, we enabled the `keepNames` esbuild when mangling was disabled, this caused dead code to be retained because of the transformations that esbuild did to the input. Input ```js class foo {} ``` Output ```js var l = Object.defineProperty, a = (s, c) => l(s, "name", { value: c, configurable: !0 }); class foo {} a(foo, "foo"); ``` Previously we enabled the `keepNames` esbuild option when mangling was disabled, which is actually not needed to retain the name of symbols but is needed for SSR because Domino relies on the `name` property on functions and classes. Closes #22354 (cherry picked from commit 2c9a33d)
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
🚀 Feature request
Command (mark with an
x
)Description
Currently it's not possible to use
ng build
to perform dead code elimination via Terser, but retain symbol names in generated JS bundle. It'd be useful to have this capability to simplify bundle size-related investigations (which often times involves looking for retained symbols).// cc @alan-agius4
The text was updated successfully, but these errors were encountered: