*graphic from a great @paulirish talk about tools.
using ant...
jake is a JavaScript build tool, similar to Make or Rake. Built to work with Node.js.
desc('This is the default task.');
task('default', function (params) {
console.log('This is the default task.');
});
There's also a CoffeeScript version called cake.
grunt.initConfig({
min: {
dist: {
src: ['src/source1.js', 'src/source2.js'],
dest: 'dist/built.min.js'
}
}
});
grunt favors the “configuration” approach for tasks for one simple reason: people seem to prefer a more declarative “configuration” style approach to a “scripting” approach.
Lots of common tasks and plugins that you can configure in a JSON object, but you also can script with the full power of node.js.
// Load some grunt tasks we’ve developed from the npm package grunt-barkeep.
grunt.loadNpmTasks('grunt-barkeep');
// Load grunt-shell
grunt.loadNpmTasks('grunt-shell');
// Load grunt-jasmine
grunt.loadNpmTasks('grunt-jasmine');
It's easy to create your own plugins.
Check out gruntjs.com
var js = grunt.file.expandFiles(task.file.src);
// Hey, async is available in grunt.utils.
grunt.utils.async.forEach(js, function (fn, callback) {
// ...
if (err) {
// Fatal error logging
grunt.fail.fatal(err);
}
});
rm -rf *.js