spine / hem

Bundler for Node/CommonJS/Web Apps
MIT License
281 stars 71 forks source link

uglify/minify bug #75

Closed richardhundt closed 11 years ago

richardhundt commented 11 years ago

I'm seeing missing semicolons between module defines which has the effect of JS parsing two consecutive definitions as chained function calls:

(function() { ... }).call(this)(function() { ... }).call(this)

There should be a statement separator in between. It's there if I hem build -d.

There seems to be a related discussion here: https://github.com/mishoo/UglifyJS/issues/126

I can't see whether hem is first concatenating and then passing the whole chunk to uglify, or doing it incrementally and then writing the pieces out consecutively to the output (in which case it should be fairly simple to insert a semicolon between the compilation units).

I've tried the v2.4.0 uglify cli on the output of hem build -d and it produces correct code.

cengebretson commented 11 years ago

Thanks for the note, I'll see if I can update the uglify package that hem uses to the latest/greatest this week. Sounds like it fixes the issue you are seeing.

cengebretson commented 11 years ago

I updated the master branch if you wanted to give it a shot, I did a couple quick tests and it seemed ok.

richardhundt commented 11 years ago

It works! Awesome, thanks.