Skip to content
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

alias function definitions to variables so terser can mangle their names #161

Open
samualtnorman opened this issue Apr 25, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@samualtnorman
Copy link
Owner

samualtnorman commented Apr 25, 2024

like as in turn

let someFunctionWithALongName = () => {
	// do some stuff
}

someFunctionWithALongName()
someFunctionWithALongName()

into

let someFunctionWithALongName = () => {
	// do some stuff
}

let _00000000000_LOCAL_FUNCTION_ALIAS_someFunctionWithALongName_ = someFunctionWithALongName

_00000000000_LOCAL_FUNCTION_ALIAS_someFunctionWithALongName_()
_00000000000_LOCAL_FUNCTION_ALIAS_someFunctionWithALongName_()

and then hand it off to terser.

terser currently has a bug that will cause the name of someFunctionWithALongName() to be clobbered if I do the above transformation.
I will wait for terser to amend this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant