-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.coffee
150 lines (126 loc) · 3.21 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
module.exports = (grunt) ->
grunt.initConfig
pkg: grunt.file.readJSON('package.json')
clean:
release:[
"release/*"
]
build:[
"build/*"
]
copy:
package:
src: "src/nw.json"
dest: "release/package.json"
html:
src: "build/index.html"
dest: "release/index.html"
concat:
css:
src: ['build/stylesheets/**/*.css']
dest: 'release/stylesheets/application.css'
templates:
src: ['build/templates/**/*.js']
dest: 'release/javascripts/application.js'
js:
src: ['build/javascripts/**/*.js']
dest: 'release/javascripts/application.js'
cssmin:
minify:
src: 'release/stylesheets/application.css'
dest: 'release/stylesheets/application.min.css'
uglify:
compile:
expand: true
cwd: 'release/javascripts/'
src: ['*.js', '!*.min.js']
dest: 'release/javascripts'
ext: '.min.js'
jade:
templates:
options:
client: true
processName: (tmpl)->
tmpl.replace('src/templates/','').replace('.jst.jade','')
expand: true
flatten: false
src: '**/*.jst.jade'
dest: 'build/templates'
cwd: 'src/templates'
ext: '.js'
views:
expand: true
flatten: false
src: '**/*.jade'
dest: 'build/'
cwd: 'src/views'
ext: '.html'
watch:
coffee:
files: 'src/coffeescripts/**/*.coffee'
tasks: ['coffee']
less:
files: 'src/stylesheets/**/*.less'
tasks: ['less']
jade:
files: 'src/templates/**/*.jade'
tasks: ['jade']
less:
compile:
expand: true
flatten: false
cwd: 'src/stylesheets'
src: '**/*.less'
dest: 'build/stylesheets/'
ext: '.css'
coffee:
compile:
expand: true
flatten: false
src: '**/*.coffee',
dest: 'build/javascripts/'
cwd: 'src/coffeescripts'
ext: '.js'
nodewebkit:
options:
build_dir: "./webkit"
mac: true
win: false
linux32: false
linux64: false
src: ["./release/**/*"]
githubPages:
target:
src: "release"
dest: "deploy"
options:
commitMessage: "Deploying site"
grunt.loadNpmTasks 'grunt-contrib-watch'
grunt.loadNpmTasks "grunt-contrib-coffee"
grunt.loadNpmTasks "grunt-contrib-less"
grunt.loadNpmTasks "grunt-contrib-jade"
grunt.loadNpmTasks "grunt-contrib-clean"
grunt.loadNpmTasks "grunt-contrib-concat"
grunt.loadNpmTasks "grunt-contrib-uglify"
grunt.loadNpmTasks "grunt-contrib-cssmin"
grunt.loadNpmTasks "grunt-contrib-copy"
grunt.loadNpmTasks "grunt-github-pages"
grunt.loadNpmTasks "grunt-node-webkit-builder"
grunt.registerTask 'default', ['watch']
grunt.registerTask 'deploy', ['githubPages:target']
grunt.registerTask 'package', ['release','copy:package', 'nodewebkit']
grunt.registerTask 'build',
[
'clean'
'coffee'
'less'
'jade'
]
grunt.registerTask 'release',
[
'build'
'concat'
'copy'
'uglify'
'cssmin'
]