forked from mozilla/webmaker-profile-2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.coffee
223 lines (201 loc) · 5.16 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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
module.exports = (grunt) ->
grunt.initConfig
less:
options:
sourceMap: true
sourceMapBasepath: "app"
sourceMapRootpath: "/"
development:
files:
"app/_compiled/app.ltr.css": "app/_less/app.less"
production:
files:
".static/_css/app.ltr.css": "app/_less/app.less"
reload:
files:
".tmp/_compiled/app.ltr.css": "app/_less/app.less"
shell:
server:
options:
async: true
command: 'node server'
reload:
options:
async: true
command: 'node server --path=../.tmp'
clean: [
".tmp"
".static"
]
watch:
options:
cwd: "app"
spawn: true
passive:
files: [
'_less/**/*.less'
]
options:
livereload: false
tasks: [
"less:development"
]
reload:
options:
spawn: false
livereload: true
interrupt: true
atBegin: true
files: [
'_img/**/*.*'
'_js/**/*.js'
'_less/**/*.less'
'_partials/**/*.html'
'index.html'
]
tasks: [
"copy:stageJS"
"copy:stagePartials"
"copy:stageImages"
"less:reload"
"dom_munger:reload"
]
copy:
reloadInit:
files: [
expand: true
cwd: "app"
src: "_bower_components/**/*.*"
dest: ".tmp/"
]
stageJS:
files: [
expand: true
cwd: "app"
src: "_js/**/*.js"
dest: ".tmp/"
]
stagePartials:
files: [
expand: true
cwd: "app"
src: "_partials/**/*.html"
dest: ".tmp/"
]
stageImages:
files: [
expand: true
cwd: "app"
src: "_img/**/*.*"
dest: ".tmp/"
]
dom_munger:
reload:
options:
append:
selector: "body"
html: "<script src=\"//localhost:35729/livereload.js\" id=\"liveReloadScript\"></script>"
src: "app/index.html"
dest: ".tmp/index.html"
autoprefixer:
options:
browsers: ["last 2 versions"]
build:
src: ".static/_css/app.ltr.css"
dest: "app/_compiled/app.ltr.css"
jshint:
all: [
"Gruntfile.js"
"app/_js/**/*.js"
]
options:
jshintrc: ".jshintrc"
jsbeautifier:
modify:
src: [
"app/_js/**/*.js"
"app/index.html"
"app/_partials/**/*.html"
]
options:
config: ".jsbeautifyrc"
validate:
src: [
"app/_js/**/*.js"
"app/index.html"
"app/_partials/**/*.html"
]
options:
mode: "VERIFY_ONLY"
config: ".jsbeautifyrc"
uglify:
dependencies:
options:
sourceMap: true
mangle: false
files:
'app/_compiled/dependencies.min.js': [
'app/_bower_components/webmaker-auth-client/dist/webmaker-auth-client.min.js'
'app/_bower_components/makeapi-client/src/make-api.js'
'app/_bower_components/jquery/dist/jquery.js'
'app/_bower_components/selectize/dist/js/standalone/selectize.js'
'app/_bower_components/angular/angular.js'
'app/_bower_components/angular-route/angular-route.js'
'app/_bower_components/angular-resource/angular-resource.js'
'app/_bower_components/angular-bootstrap/ui-bootstrap.js'
'app/_bower_components/angular-bootstrap/ui-bootstrap-tpls.js'
'app/_bower_components/angular-sanitize/angular-sanitize.js'
'app/_bower_components/locompleter/locompleter.js'
'app/_bower_components/webmaker-analytics/analytics.js'
]
app:
options:
sourceMap: true
mangle: false
files:
'app/_compiled/app.min.js': 'app/_js/**/*.js'
grunt.loadNpmTasks "grunt-shell-spawn"
grunt.loadNpmTasks "grunt-jsbeautifier"
grunt.loadNpmTasks "grunt-contrib-jshint"
grunt.loadNpmTasks "grunt-contrib-watch"
grunt.loadNpmTasks "grunt-contrib-less"
grunt.loadNpmTasks "grunt-dom-munger"
grunt.loadNpmTasks "grunt-autoprefixer"
grunt.loadNpmTasks "grunt-contrib-copy"
grunt.loadNpmTasks "grunt-contrib-clean"
grunt.loadNpmTasks "grunt-contrib-uglify"
# Development server
grunt.registerTask "server", [
"less:development"
"uglify"
"shell:server"
"watch:passive"
]
# Default task is development server for b-wds compatibility
grunt.registerTask "default", [
"server"
]
# Development server + livereload
grunt.registerTask "live-server", [
"clean"
"copy:reloadInit"
"shell:reload"
"watch:reload"
]
# Clean code before a commit
grunt.registerTask "lint", [
"jsbeautifier:modify"
"jshint"
]
# Validate code (read only)
grunt.registerTask "validate", [
"jsbeautifier:validate"
"jshint"
]
# Build for Production
grunt.registerTask "build", [
"less:production"
"uglify"
"autoprefixer:build"
]
return