We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This was also an issue with JShrink: tedious/JShrink#87 and is actually how I came across your issue related to that here: tedious/JShrink#105
But I'm still seeing this issue with js-minify.
For example:
function hello () { console.log('Hello World') } console.log('yay')
Should become:
function hello(){console.log('Hello World')}console.log('yay')
But currently it becomes:
function hello(){console.log('Hello World')} console.log('yay')
The text was updated successfully, but these errors were encountered:
Hi @kodie,
The reason why the library doesn't remove this whitespace can best be explained with a simple example:
let hello = function() { console.log('Hello World') } console.log('yay')
if this becomes
let hello = function(){console.log('Hello World')}console.log('yay')
the result of evaluation is
Uncaught SyntaxError: Unexpected identifier
I think this issue can only be resolved by full parsing the javascript file but this takes a lot of time.
Sorry, something went wrong.
@garfix In that case, couldn't we have it append a semicolon to the end of the function? So it becomes:
let hello = function(){console.log('Hello World')};console.log('yay')
I elaborated on the semicolon versus newline decision in #1.
No branches or pull requests
This was also an issue with JShrink: tedious/JShrink#87 and is actually how I came across your issue related to that here: tedious/JShrink#105
But I'm still seeing this issue with js-minify.
For example:
Should become:
But currently it becomes:
The text was updated successfully, but these errors were encountered: