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

Empty minified output when input is a single plain string #5368

Closed
JeanSamGirard opened this issue Feb 23, 2022 · 2 comments · Fixed by #5369
Closed

Empty minified output when input is a single plain string #5368

JeanSamGirard opened this issue Feb 23, 2022 · 2 comments · Fixed by #5369
Labels

Comments

@JeanSamGirard
Copy link

I'm using uglifyjs to minify user code transpiled in javascript by another algorythm that produces javascript expressions.

Everything works until the generated javascript is a plain string with no other operations.

Trying to minify a plain string result in an empty string output.

Uglify version (3.15.1)

JavaScript input : "my string"

minify(js, { mangle: false, compress: { expression: true } })

Output : ""

Expected Output : "my string"


My current workaround is injecting + "" before minifying generated javascript when the output is a plain string

@alexlamsl
Copy link
Collaborator

Thanks for the detailed report.

Confirmed as a regression since uglify-js@3.4.3 caused by 76df77c − investigating.

@alexlamsl
Copy link
Collaborator

Fix released in uglify-js@3.15.2

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

Successfully merging a pull request may close this issue.

2 participants