-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathGruntfile.coffee
More file actions
49 lines (42 loc) · 1.34 KB
/
Gruntfile.coffee
File metadata and controls
49 lines (42 loc) · 1.34 KB
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
module.exports = (grunt) ->
grunt.loadNpmTasks 'grunt-contrib-coffee'
grunt.loadNpmTasks 'grunt-contrib-concat'
grunt.loadNpmTasks 'grunt-contrib-uglify'
grunt.loadNpmTasks 'grunt-contrib-watch'
grunt.loadNpmTasks 'grunt-jstestdriver'
grunt.initConfig
pkg:grunt.file.readJSON('package.json')
coffee:
core:
files: [
expand: true
cwd: 'src/'
src: ['**/*.coffee']
dest: 'tmp/'
ext: '.js'
]
concat:
core:
src: [ "src/**/*.js", "tmp/**/*.js"]
dest: "build/<%= pkg.name %>.js"
uglify:
options:
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
core:
src: "build/<%= pkg.name %>.js"
dest: "build/<%= pkg.name %>.min.js"
jstestdriver:
files: ["JsTestDriver.conf"]
watch:
coffee:
files: "src/**/*.coffee"
tasks: ["coffee"]
changed:
files: ["src/**/*.js","tmp/**/*.js"]
tasks: ["build"]
jstestdriver:
files: ["test/**/*.js"]
tasks: ["jstestdriver"]
grunt.registerTask "test", ["jstestdriver"]
grunt.registerTask "run", ["coffee", "concat", "uglify", "jstestdriver", "watch"]
grunt.registerTask "build", ["coffee", "concat", "uglify", "jstestdriver"]