Skip to content

Instantly share code, notes, and snippets.

@teisman
Last active December 10, 2015 21:28
Show Gist options
  • Save teisman/4494993 to your computer and use it in GitHub Desktop.
Save teisman/4494993 to your computer and use it in GitHub Desktop.

The basic layout of my typical Gruntfile.coffee is as follows

module.exports = (grunt) ->
  grunt.initConfig
    pkg:
      grunt.file.readJSON 'package.json'
    
    coffee:
      compile:
        files:
          'lib/destination1.js': [
            'src/source1.coffee'
            'src/sourc2.coffee'
          ]

  grunt.loadNpmTasks 'grunt-contrib-coffee'
  grunt.registerTask 'default', ['coffee']

Gruntfile.coffee is placed in the root of the project repository. Since the default task calls the coffee method, invoking grunt will result in the compilation of all source files into the destination file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment