51e132e9 by Michael Richards

Add grunt.js file with a linter, minifier, compiler, build script (compile + min…

…ify) and a watcher to automatically build.
1 parent 0217de73
Showing 1 changed file with 27 additions and 0 deletions
module.exports = function(grunt) {
grunt.initConfig({
lint: {
files: ['grunt.js', 'lib/**/*.js', 'spec/**/*.js']
},
min: {
dist: {
src: 'lib/rivets.js',
dest: 'lib/rivets.min.js'
}
},
watch: {
files: 'src/rivets.coffee',
tasks: 'build'
},
});
grunt.registerTask('default', 'watch');
grunt.registerTask('compile', 'Compiles CoffeeScript source into JavaScript.', function(){
var coffee = require('coffee-script');
var js = coffee.compile(grunt.file.read('src/rivets.coffee'));
if (js) grunt.file.write('lib/rivets.js', js);
});
grunt.registerTask('build', 'compile min');
};