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

Mangle Properties Fix #48

Merged
merged 2 commits into from
Nov 27, 2023
Merged

Conversation

khaitu
Copy link
Contributor

@khaitu khaitu commented Nov 27, 2023

Terser would not process any scripts when the mangle_properties config was set. This was due to a problem with the Terser library expecting the global variable to be defined, which it is in a normal NodeJS environment, but unfortunately in an ExecJS abstract context it is stripped out presumable to provide consistency with other Javascript runners.

The fix I implemented is to check for the presence of global and if not set, set it.

var global = global || {};

This should not break anything, and now all processing completes and the specs pass.

@ahorek ahorek merged commit 6888b3f into ahorek:master Nov 27, 2023
10 checks passed
@ahorek
Copy link
Owner

ahorek commented Nov 27, 2023

nice, thank you very much for this fix @khaitu !

@khaitu
Copy link
Contributor Author

khaitu commented Nov 27, 2023

Thank you for this library!

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

Successfully merging this pull request may close these issues.

2 participants