forked from dropzone/dropzone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.coffee
96 lines (79 loc) · 2.3 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
93
94
95
96
module.exports = (grunt) ->
grunt.initConfig
pkg: grunt.file.readJSON "package.json"
stylus:
options:
compress: false
default:
files: [
"downloads/css/basic.css": "downloads/css/stylus/basic.styl"
"downloads/css/dropzone.css": "downloads/css/stylus/dropzone.styl"
]
coffee:
default:
files:
"lib/dropzone.js": "src/dropzone.coffee"
test:
files:
"test/test.js": "test/*.coffee"
componentbuild:
options:
standalone: "Dropzone"
app:
# output: "build/"
name: "build"
src: "."
dest: "./build"
# config: "component.json"
# styles: false
# scripts: true
copy:
component:
src: "build/build.js"
dest: "downloads/dropzone.js"
concat:
amd:
src: [
"AMD_header"
"components/component-emitter/index.js"
"lib/dropzone.js"
"AMD_footer"
]
dest: "downloads/dropzone-amd-module.js"
watch:
js:
files: [
"src/dropzone.coffee"
]
tasks: [ "js" ]
options: nospawn: on
test:
files: [
"test/*.coffee"
]
tasks: [ "coffee:test" ]
options: nospawn: on
css:
files: [
"downloads/css/stylus/*.styl"
]
tasks: [ "css" ]
options: nospawn: on
uglify:
js:
files: [
"downloads/dropzone-amd-module.min.js": "downloads/dropzone-amd-module.js"
"downloads/dropzone.min.js": "downloads/dropzone.js"
]
grunt.loadNpmTasks "grunt-contrib-coffee"
grunt.loadNpmTasks "grunt-component-build"
grunt.loadNpmTasks "grunt-contrib-stylus"
grunt.loadNpmTasks "grunt-contrib-copy"
grunt.loadNpmTasks "grunt-contrib-concat"
grunt.loadNpmTasks "grunt-contrib-watch"
grunt.loadNpmTasks "grunt-contrib-uglify"
# Default tasks
grunt.registerTask "default", [ "downloads" ]
grunt.registerTask "css", "Compile the stylus files to css", [ "stylus" ]
grunt.registerTask "js", "Compile coffeescript", [ "coffee", "componentbuild", "copy", "concat" ]
grunt.registerTask "downloads", "Compile all stylus and coffeescript files and generate the download files", [ "js", "css", "uglify" ]