dave / jsgo

GopherJS compiler, serving framework and CDN.
https://jsgo.io/<path>
MIT License
269 stars 11 forks source link

UglifyJS #17

Open pjebs opened 5 years ago

pjebs commented 5 years ago

It would be great if you run uglify/ugllify2 afterwards to further minimize file size.

dave commented 5 years ago

Thanks for the suggestion! However, in jsgo everything runs in the Go process, so without a Go version of uglify this wouldn't be possible.

dave commented 5 years ago

BTW did you run any tests to see what percentage compression uglify gives? GopherJS has it's own minify routine which probably isn't as good as uglify but I wouldn't think the difference is that great...

pjebs commented 5 years ago

I remember doing a comparison 5-6 months ago and uglification created serious improvements to size (non-negligible).

I think a docker based solution is the way to go if you want to run uglify as easily as possible.

dave commented 5 years ago

Adding this to the jsgo compiler would be a huge undertaking. Right now everything runs inside a single Go process - that keeps the architecture very simple. Adding docker as a dependency would make things much more complex.

Also, I'm working on other projects now, so won't have any more time for new jsgo features.