This repository has been archived by the owner on Jun 5, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.coffee
71 lines (56 loc) · 1.63 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
module.exports = (grunt) ->
prefix = grunt.option('dest') || './src/main/webapp/resources'
root = grunt.option('root') || './src/main/webapp/resources'
coffeeFiles = {};
sourceFiles = [ "#{prefix}/js/sync/*.js"
"#{prefix}/js/views/main/*.js"
"#{prefix}/js/views/*.js"
"#{prefix}/js/models/*.js"
"#{prefix}/js/collections/*.js"]
uglifyFiles = {}
uglifyFiles["#{prefix}/js/paygo.js"] = sourceFiles
uglifyFiles["#{prefix}/js/paygo.min.js"] = "#{prefix}/js/paygo.js"
grunt.initConfig({
pkg: grunt.file.readJSON("package.json"),
coffee: {
production: {
options: {
bare: true
join: true
},
files: coffeeFiles
}
develop: {
options: {
bare: true
join: true
sourceMap: true
},
files: coffeeFiles
}
}
uglify:
production:
options:
mangle: true
compress: true
files: uglifyFiles
develop:
options:
beautify: true
mangle: false
compress: false
files: uglifyFiles
watch: {
coffee: {
files : sourceFiles
tasks : ["uglify:develop"]
}
}
}
)
grunt.loadNpmTasks "grunt-contrib-coffee"
grunt.loadNpmTasks "grunt-contrib-uglify"
grunt.loadNpmTasks 'grunt-contrib-watch'
grunt.registerTask "develop", ["coffee:production", "uglify:production"]
grunt.registerTask "default", ["coffee:develop", "uglify:develop"]