Skip to content

Commit ccf02f1

Browse files
committed
Merge pull request #17 from qiniupd/8418_import_grunt
8418 import grunt
2 parents 8550b40 + c89c23a commit ccf02f1

File tree

7 files changed

+88
-778
lines changed

7 files changed

+88
-778
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
node_*
22
.DS_Store
3+
demo/js/qiniu.js
4+
Gruntfile.js

Gruntfile.coffee

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
module.exports = (grunt) ->
2+
JS_PATH = 'src/'
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+
'src/qiniu.min.js' : [JS_FILE]
17+
copy:
18+
main:
19+
expand: true
20+
flatten: true
21+
src: 'src/qiniu.js'
22+
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'
40+
41+
grunt.loadNpmTasks 'grunt-contrib-watch'
42+
grunt.loadNpmTasks 'grunt-contrib-uglify'
43+
grunt.loadNpmTasks 'grunt-contrib-jshint'
44+
grunt.loadNpmTasks 'grunt-contrib-copy'
45+
46+
grunt.event.on 'watch', (action, filepath) ->
47+
grunt.config ['jshint', 'all'], filepath
48+
49+
grunt.registerTask 'production', [
50+
'jshint'
51+
'copy'
52+
'uglify:compress'
53+
]
54+
55+
grunt.registerTask 'default', [
56+
'jshint'
57+
'copy'
58+
'uglify:compress'
59+
]

demo/js/jquery.min.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)