Skip to content

Add ability to set keepNames for esbuild #26768

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

Closed
foxel opened this issue Dec 29, 2023 · 3 comments
Closed

Add ability to set keepNames for esbuild #26768

foxel opened this issue Dec 29, 2023 · 3 comments

Comments

@foxel
Copy link

foxel commented Dec 29, 2023

Command

build, serve

Description

esbuild optimizes TS code with decorators a bit different to tsc. This is not a huge difference but class names are lost if a class is decorated. There is keepNames (keep-names) option in esbuild that ensures the name is restored. It would be great if angular cli expose this opton in angular.json

Describe the solution you'd like

keepNames can be exposed in angular.json under AngularDevkitBuildAngularBuildersBrowserEsbuildSchema

getEsBuildCommonOptions in this case should just forward this option to BuildOptions

Describe alternatives you've considered

Currently, I've patched getEsBuildCommonOptions to set keepNames as !optimizationOptions.scripts within my project.
Setting the keepNames this way might be an alternative, but explicit exposure is best IMHO

@alan-agius4
Copy link
Collaborator

Duplicate of #15761 and #14487

@alan-agius4 alan-agius4 closed this as not planned Won't fix, can't repro, duplicate, stale Dec 29, 2023
@foxel
Copy link
Author

foxel commented Dec 29, 2023

@alan-agius4 how is this a duplicate? I don't see common points

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jan 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants