- Check if your javascript are valid with jslint.
- Minify your javascript with Closure Compiler (optimize and minify your code).
- Watch your javascript files for jslint while you're coding.
- Create an aggregated file of all your javascripts.
-
run
git submodule add git://github.com/dsimard/ready.js.git ready.js
-
run
cd ready.js && git submodule init && git submodule update && cd ..
-
Create config file in your_project/ready.conf.js :
{ src : "./javascripts", // the source dir of js files dest : "./minified", // the destination of your compiled files }
-
run
echo 'node ready.js/bin/ready.js ready.conf.js' >> .git/hooks/pre-commit
Then, every time you commit, ready.js will be run.
run node ready.js/bin/ready.watch.js ready.conf.js
See the wiki for alternatives installations.
Why not using ruby gems?
I don't like to have external dependencies. I mean gems are cool but for something that simple, it's an overkill. Plus, I didn't want to tie ready.js to the Rails or the node community. You can use it for any project that has javascript files in it, which mean 99.97% of web projects alive today.
Why not using Google Closure Compiler jar file?
I could have used it but it's in java and because I want the minimum external dependency, I could use it. In fact, I never installed java on my dev machine and probably never will, I'm afraid it could break things (and probably would).
Why using node.js?
Because I really wanted to work with it.