-
Notifications
You must be signed in to change notification settings - Fork 50
/
Gruntfile.coffee
29 lines (24 loc) · 1.07 KB
/
Gruntfile.coffee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# global module:false
module.exports = (grunt) ->
coffeeRename = (dest, src)->
dest + '/' + src.replace(/\.coffee$/, '.js')
# Project configuration.
grunt.initConfig
watch:
tasks: ["coffee"]
files: ["configs/**/*.coffee", "lib/**/*.coffee", "models/**/*.coffee", "routes/**/*.coffee", "tests/helpers/*.coffee"]
options:
spawn: false
coffee:
compile:
files: [
{expand: true, cwd: 'configs', src: ['**/*.coffee'], dest: 'configs', rename: coffeeRename}
{expand: true, cwd: 'models', src: ['**/*.coffee'], dest: 'models', rename: coffeeRename}
{expand: true, cwd: 'lib', src: ['**/*.coffee'], dest: 'lib', rename: coffeeRename}
{expand: true, cwd: 'routes', src: ['**/*.coffee'], dest: 'routes', rename: coffeeRename}
{expand: true, cwd: 'tests/helpers', src: ['*.coffee'], dest: 'tests/helpers', rename: coffeeRename}
]
grunt.loadNpmTasks "grunt-contrib-coffee"
grunt.loadNpmTasks "grunt-contrib-watch"
# Default task.
grunt.registerTask "default", "coffee"