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

Uglify or Minimify the standard js files #366

Closed
juliomatcom opened this issue Dec 22, 2015 · 7 comments

Comments

@juliomatcom
Copy link

commented Dec 22, 2015

Hello,
Sorry, this is not a real issue, just a concern, what do you suggest to minimify or uglify the js files without the semicolons ? any package or some thing in the comunity?

Thank you

@juliomatcom juliomatcom changed the title Uglify - Minimify - and others Uglify - Minimify the standard js files Dec 22, 2015

@juliomatcom juliomatcom changed the title Uglify - Minimify the standard js files Uglify or Minimify the standard js files Dec 22, 2015

@bcomnes

This comment has been minimized.

Copy link
Member

commented Dec 23, 2015

I would stay away from any minification tool or uglify tool that does not ensure correct ASI during its transform. Semicolons are a necessary for those types of tools to work. So the answer is... any of them (that work presumably)!

Personally I would look for one that works well with my build step via browserify e.g. https://github.com/hughsk/uglifyify (not I have not used this or endorse it, but it looks like something I would try out).

Does that answer your question?

@rstacruz

This comment has been minimized.

Copy link
Member

commented Dec 23, 2015

Any modern minification tool would suffice. Most today would parse based on
AST. These two are what most would use:

  • uglifyjs
  • Closure compiler

On Wednesday, December 23, 2015, Bret Comnes notifications@github.com
wrote:

I would stay away from any minification tool or uglify tool that does not
ensure correct ASI during its transform. Semicolons are a necessary for
those types of tools to work. So the answer is... any of them (that work
presumably)!

Personally I would look for one that works well with my build step via
browserify e.g. https://github.com/hughsk/uglifyify (not I have not used
this or endorse it, but it looks like something I would try out).


Reply to this email directly or view it on GitHub
#366 (comment).

@juliomatcom

This comment has been minimized.

Copy link
Author

commented Dec 23, 2015

Is possible to get the original ASI that use javascript engine with some api ?
I would give a try to this libs
There is any mailing list to send or share the results.. a mailing about standard js ?

Thanks

@bcomnes

This comment has been minimized.

Copy link
Member

commented Dec 23, 2015

I have not heard of a module or API that lets you patch in directly to V8's ASI capabilities. Googling, I came across http://blog.izs.me/post/2353458699/an-open-letter-to-javascript-leaders-regarding which actually addresses your first question:

Yes, [ASI is] quite safe, and perfectly valid JS that every browser understands. Closure compiler, yuicompressor, packer, and jsmin all can properly minify it. There is no performance impact anywhere.
-- http://blog.izs.me/post/2353458699/an-open-letter-to-javascript-leaders-regarding

We have https://github.com/Flet/semistandard for people working on projects that need semicolons for political or style reasons. Not sure if that helps.

If you come up with anything cool that you want to share just open up an issue or hop onto #standard on freenode.

@juliomatcom

This comment has been minimized.

Copy link
Author

commented Dec 23, 2015

+1 thanks @bcomnes

@rstacruz

This comment has been minimized.

Copy link
Member

commented Dec 25, 2015

Is possible to get the original ASI that use javascript engine with some api ?

This might help: http://esprima.org/demo/parse.html#

@feross

This comment has been minimized.

Copy link
Member

commented Dec 25, 2015

All the popular minification tools will work just fine on code that passes standard. No need to worry.

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
4 participants
You can’t perform that action at this time.