Created
May 12, 2014 23:44
-
-
Save georgicodes/2d3fe734c98cd1197e4a to your computer and use it in GitHub Desktop.
A simple Gruntfile which watches a directory for changes to coffeescript files, compiles them and also runs coffeelint. An additional MochaTest tasks runs independently.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module.exports = function(grunt) { | |
| // Project configuration. | |
| grunt.initConfig({ | |
| pkg: grunt.file.readJSON('package.json'), | |
| watch: { | |
| coffee: { | |
| files:['src/**/*.coffee'], | |
| tasks: ['coffee:compileAll', 'coffeelint:app'], | |
| options: { | |
| spawn: false | |
| } | |
| } | |
| }, | |
| coffee: { | |
| compileAll: { | |
| expand: true, | |
| bare: true, | |
| cwd: 'src', | |
| src: '**/*.coffee', | |
| dest: 'lib', | |
| ext: '.js' | |
| } | |
| }, | |
| coffeelint: { | |
| app: ['src/**/*.coffee'] | |
| }, | |
| mochaTest: { | |
| test: { | |
| options: { | |
| reporter: 'spec', | |
| require: 'coffee-script/register' | |
| }, | |
| src: ['test/**/*.coffee'] | |
| } | |
| } | |
| }); | |
| grunt.loadNpmTasks('grunt-contrib-coffee'); | |
| grunt.loadNpmTasks('grunt-contrib-watch'); | |
| grunt.loadNpmTasks('grunt-coffeelint'); | |
| grunt.loadNpmTasks('grunt-mocha-test'); | |
| // Default task(s). | |
| grunt.registerTask('default', ['coffee', 'watch', 'coffeelint', 'mochaTest']); | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment