-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.coffee
92 lines (91 loc) · 1.98 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
module.exports = (grunt)->
grunt.loadNpmTasks('grunt-contrib-clean')
grunt.loadNpmTasks('grunt-contrib-uglify')
grunt.loadNpmTasks('grunt-contrib-watch')
grunt.loadNpmTasks('grunt-contrib-copy')
grunt.loadNpmTasks('grunt-karma')
grunt.loadNpmTasks('grunt-contrib-coffee')
grunt.loadNpmTasks('grunt-coffeelint')
grunt.loadNpmTasks('grunt-bumpx')
grunt.initConfig(
pkg:
grunt.file.readJSON('package.json')
clean:
dist: ['dist', 'dist/hotkey.js', 'hotkey.min.js']
bump:
options:
part: 'patch'
files: [ 'package.json', 'bower.json']
copy:
angular:
files: [
cwd: 'bower_components/angular/'
src: [
'angular.min.js'
'angular.min.js.map'
]
dest: 'dist'
expand: true
filter: 'isFile'
]
root:
files: [
cwd: 'src'
src: [
'demo.html'
]
dest: 'dist'
expand: true
filter: 'isFile'
]
coffee:
options:
bare: true
main:
files:
'dist/hotkey.js': [
'src/key_handler.coffee'
'src/hotkey.coffee'
]
uglify:
main:
files:
'hotkey.min.js': [
'dist/hotkey.js'
]
watch:
html:
files: [
'src/*.html'
]
tasks: ['copy:root']
coffee:
files: [
'src/*.coffee'
]
tasks: ['coffee']
karma:
options:
configFile: 'karma.conf.js'
dev:
colors: true,
travis:
singleRun: true
autoWatch: false
)
grunt.registerTask('test', ['karma'])
grunt.registerTask('dev', [
'clean'
'copy',
'coffee'
])
grunt.registerTask('dist', [
'dev'
'uglify'
])
grunt.registerTask('deploy', [
'bump'
'dist'
])
grunt.registerTask('travis', 'travis test', ['karma:travis'])
grunt.registerTask('default', ['dist'])