Skip to content

Instantly share code, notes, and snippets.

@jcollum
Created April 24, 2013 19:28
Show Gist options
  • Save jcollum/5454854 to your computer and use it in GitHub Desktop.
Save jcollum/5454854 to your computer and use it in GitHub Desktop.
grunt watcher for multiple-to-multiple coffee-to-js compililation (with source maps)
###
command line: grunt watch
###
# global module:false
module.exports = (grunt) ->
# Project configuration.
grunt.initConfig
watch:
coffee:
files: '**/*.coffee',
tasks: 'coffee'
coffee:
src_to_multiple:
options:
sourceMap: true
expand: true,
flatten: false,
cwd: 'assets/src/coffee',
src: ['**/*.coffee'],
dest: 'assets/js',
ext: '.js'
grunt.loadNpmTasks "grunt-contrib-coffee"
grunt.loadNpmTasks('grunt-contrib-watch')
# Default task.
grunt.registerTask "default", "watch"
grunt.event.on('watch', (action, filepath) -> (grunt.log.writeln(filepath + ' has ' + action)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment