Some Resources to Help You Get Started With Grunt.js
I have been a bit worried about deploying cleartext javascript to my production environment for a while now. The hassle of obfuscating always put me off:
Grunt.js looks like it might be my saviour here. Having come from (and still being in) the Java world I think of this as being Ant for javascript. Just what I was after.
I am just doing a bit each day so as not to interfere too much with the day job, but so far I have added these tasks (in development at least, I am not doing anything with grunt on live code yet):
Remove white space from js files with uglify
Compress javascript to gzip
Run my existing QUnit tests
Lint my javascript
Although it is early days this looks like having the scope to make everything a bit easier.
Here are some resources I have used or am in the process of working through:
http://blog.mattbailey.co/post/45519082789/a-beginners-guide-to-grunt
http://flippinawesome.org/2013/07/01/building-a-javascript-library-with-grunt-js/
As usual in things front endy Addy Osmani's website is a useful resource.
- Use something like Google's closure service
- Change all of the references in my html to point to the generated files
- Make sure the clear text dev versions of the js are not deployed and finally
- Do the deploy
Grunt.js looks like it might be my saviour here. Having come from (and still being in) the Java world I think of this as being Ant for javascript. Just what I was after.
I am just doing a bit each day so as not to interfere too much with the day job, but so far I have added these tasks (in development at least, I am not doing anything with grunt on live code yet):
Remove white space from js files with uglify
Compress javascript to gzip
Run my existing QUnit tests
Lint my javascript
Although it is early days this looks like having the scope to make everything a bit easier.
Here are some resources I have used or am in the process of working through:
http://blog.mattbailey.co/post/45519082789/a-beginners-guide-to-grunt
http://flippinawesome.org/2013/07/01/building-a-javascript-library-with-grunt-js/
As usual in things front endy Addy Osmani's website is a useful resource.
Comments
Post a Comment