broccolijs / broccoli-sample-app

Sample Ember app for Broccoli
MIT License
89 stars 45 forks source link

uglify not working with ES6 concatenator? #15

Closed cbosco closed 10 years ago

cbosco commented 10 years ago

I am unable to trigger the uglify step in this project, but it works in my pared down sample app prior to adding the ES6 transpiler.

I have tried it with serve:

$ BROCCOLI_ENV=production && broccoli serve

And with build:

$ BROCCOLI_ENV=production && broccoli build output-dir

In both cases (with this sample app) I get a 1.8MB sized app.js file that is unminified.

I've also tried removing the production check altogether; same result.

My guess was it is an issue with the ES6 module concatenator step prior, since you perform uglify on the broccoli tree and not on the output (/assets/app.js).

In my example without ES6, compression works as I read directly from the tree instead of /assets folder.

cbosco commented 10 years ago

I have been attempting a fix that basically runs uglify on the application JS prior to finding the bower dependencies but it raises 2 issues for me

(1) I don't want to uglify every bower file if it can be avoided since that would be slow (hence running uglify prior to finding the bower trees).

But I do want to include minified vendor assets...

(2) If I explicitly choose the minified versions of bower files to include that will work today, but I understand in the future bower packages may not be including the .min.js versions of the files leaving it up to your asset pipeline to minify

cbosco commented 10 years ago

This looks like it was user error on my part; I wasn't actually adding the environment variable to my environment at all with my one-line command.

$ BROCCOLI_ENV=production && broccoli serve