-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathGruntfile.coffee
53 lines (46 loc) · 1.13 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
module.exports = (grunt)->
grunt.loadNpmTasks 'grunt-contrib-coffee'
grunt.loadNpmTasks 'grunt-contrib-watch'
grunt.loadNpmTasks 'grunt-karma'
grunt.loadNpmTasks 'grunt-contrib-uglify'
grunt.loadNpmTasks 'grunt-contrib-copy'
grunt.initConfig
coffee:
compile:
options:
sourceMap: true
watch: true
files: [
expand: true
cwd: 'src/'
src: '**/*.coffee'
dest: 'js/'
ext: '.js'
]
watch:
source:
files: [ 'src/**/*' ]
tasks: [ 'coffee' ]
karma:
unit:
configFile: 'karma.conf.coffee'
single:
configFile: 'karma.conf.coffee'
options:
singleRun: true
uglify:
source:
expand: true
cwd: 'js/'
src: '**/*.js'
dest: 'dist/'
ext: '.min.js'
copy:
source:
expand: true
cwd: 'js/'
src: '**/*.js'
dest: 'dist/'
grunt.registerTask 'dev', [ 'coffee', 'watch' ]
grunt.registerTask 'build', [ 'karma:single', 'coffee', 'copy', 'uglify' ]
grunt.registerTask 'default', [ 'dev' ]