Minifying your output with grunt-uglify

Share this video with your friends

Send Tweet

For production we want to use minified javascript to reduce the payload that is sent from the server. This can easily be accomplished with grunt-uglify.

Matt
Matt
~ 9 years ago

Ditto to Cipriano's question. Where is the video for the proper way to handle inclusion of minified files into the html file?

Joel Hooks
Joel Hooks
~ 9 years ago

There is no further lesson on this topic.

Matt
Matt
~ 9 years ago

I ended up going with a grunt tool called grunt-targethtml.

This was a painful process. There are a couple tools out there with what I consider cryptic documentation. It would be nice if the tutorials had direction for the step of inserting the new file(s) into the html page, as the author describes: "Take note though that we haven't included our new app.js in our index HTML, so it's not going to be used if we were to refresh the page. We'll get into that in a few more steps."

jean-michel
jean-michel
~ 9 years ago

I agree with Matt's point

The global picture is missing in this serie

  • which context would you use concat/uglify when uglify can do the job (as shown by John in an earlier post)?

  • a post showing how to connect the build version to have a functional site running would have been good especially if this is "painful"

Joel, egghead folks, what do you have to say?

Thanks

Jean-Michel