Last Updated: February 25, 2016
·
6.498K
· samccone

Damn simple coffeescript watch and compiling with grunt

Using a folder structure as follows

Picture

module.exports = (grunt) ->
  grunt.loadNpmTasks('grunt-contrib-coffee')
  grunt.loadNpmTasks('grunt-contrib-watch')

  grunt.initConfig
    watch:
      coffee:
        files: 'src/*.coffee'
        tasks: ['coffee:compile']

    coffee:
      compile:
        expand: true,
        flatten: true,
        cwd: "#{__dirname}/src/",
        src: ['*.coffee'],
        dest: 'js/',
        ext: '.js'

You are welcome

1 Response
Add your response

Concise. Simple. Valid.
Thank you, Sir!

over 1 year ago ·