Skip to content

Commit f0c558a

Browse files
committed
gruntfile.coffee
1 parent 99d508e commit f0c558a

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

Gruntfile.coffee

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
module.exports = (grunt) ->
2+
JS_PATH = 'js/'
3+
JS_FILE = JS_PATH+'qiniu.js'
4+
5+
grunt.initConfig
6+
jshint:
7+
options:
8+
jshintrc: '.jshintrc'
9+
all: [JS_FILE]
10+
11+
uglify:
12+
compress:
13+
options:
14+
report: 'min'
15+
files: [{
16+
expand: true
17+
src: [JS_FILE]
18+
}]
19+
copy:
20+
main:
21+
expand: true,
22+
flatten: true,
23+
src: 'src/qiniu.js',
24+
dest: 'demo/js/'
25+
26+
grunt.loadNpmTasks 'grunt-contrib-watch'
27+
grunt.loadNpmTasks 'grunt-contrib-uglify'
28+
grunt.loadNpmTasks 'grunt-contrib-jshint'
29+
grunt.loadNpmTasks 'grunt-contrib-copy'
30+
31+
grunt.event.on 'watch', (action, filepath) ->
32+
grunt.config ['jshint', 'all'], filepath
33+
34+
grunt.registerTask 'production', [
35+
'jshint'
36+
'uglify:compress'
37+
]
38+
39+
grunt.registerTask 'default', [
40+
'jshint'
41+
'copy'
42+
]

0 commit comments

Comments
 (0)