Skip to content

Conversation

@thibaudcolas
Copy link

Disclaimer: this is probably one of the worst possible fixes, but it does the job.

There is a bug / misleading feature in the smoosh tool, which removes the semicolon at the end of the compressed JavaScript output. This is perfectly fine when the compressed file (here, ready.min.js) is used as is, but it can break the code if the file is concatenated to other JS code.

Here is a fiddle which demonstrates the issue and the fix. This should be directly fixed in smoosh, so:

  • I submitted a PR to fat/smoosh, with a fix directly taken from Uglify's code (which switched to adding the semicolon some time ago, but not in smoosh's scenario).
  • Here is another PR for domready. The fix is quite terrible but I'd rather submit those changes over just a simple issue.

Hope you find this useful,

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.

1 participant