File tree Expand file tree Collapse file tree 1 file changed +25
-8
lines changed Expand file tree Collapse file tree 1 file changed +25
-8
lines changed Original file line number Diff line number Diff line change 11module .exports = (grunt ) ->
2- JS_PATH = ' js /'
2+ JS_PATH = ' src /'
33 JS_FILE = JS_PATH+ ' qiniu.js'
44
55 grunt .initConfig
@@ -12,16 +12,31 @@ module.exports = (grunt) ->
1212 compress :
1313 options :
1414 report : ' min'
15- files : [{
16- expand : true
17- src : [JS_FILE]
18- }]
15+ files :
16+ ' src/qiniu.min.js' : [JS_FILE]
1917 copy :
2018 main :
21- expand : true ,
22- flatten : true ,
23- src : ' src/qiniu.js' ,
19+ expand : true
20+ flatten : true
21+ src : ' src/qiniu.js'
2422 dest : ' demo/js/'
23+ watch :
24+ options :
25+ livereload : true
26+ debounceDelay : 600
27+ js :
28+ files : JS_FILE
29+ tasks : ' jshint'
30+ options :
31+ spawn : false
32+ copy :
33+ files : [JS_FILE]
34+ tasks : ' copy'
35+ uglify :
36+ options :
37+ report : ' min'
38+ files : [JS_FILE]
39+ tasks : ' uglify'
2540
2641 grunt .loadNpmTasks ' grunt-contrib-watch'
2742 grunt .loadNpmTasks ' grunt-contrib-uglify'
@@ -33,10 +48,12 @@ module.exports = (grunt) ->
3348
3449 grunt .registerTask ' production' , [
3550 ' jshint'
51+ ' copy'
3652 ' uglify:compress'
3753 ]
3854
3955 grunt .registerTask ' default' , [
4056 ' jshint'
4157 ' copy'
58+ ' uglify:compress'
4259 ]
You can’t perform that action at this time.
0 commit comments