-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathGruntfile.js
More file actions
248 lines (221 loc) · 8.57 KB
/
Gruntfile.js
File metadata and controls
248 lines (221 loc) · 8.57 KB
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
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
// ------------------------------
// Grunt Configuration/Setup
// ------------------------------
module.exports = function (grunt) {
'use strict';
// Project configuration
var options = {
init: true,
data: {
pkg: grunt.file.readJSON('package.json'),
releaseVersion: grunt.option('releaseVersion') || '',
config: {
/**
* Config - Edit this section
* ==========================
* Choose javascript release filename
* Choose javascript release location
* Choose javascript files to be uglified
* Choose images location
* Choose css release location
* Choose scss files to be compiled
* Choose foundation scss location
* Choose bower components location
*/
js: {
// <%=config.js.releaseDir%>
releaseDir: 'web/js/release/',
// <%=config.js.releaseFile%>
releaseFile: 'scripts.min.js',
// <%=config.js.modernizrReleaseFile%>
modernizrReleaseFile: 'modernizr.min.js',
// <%=config.js.scriptFileList%>
scriptFileList: [
'web/bower_components/jquery/jquery.js',
// Include only used Foundation 5 scripts if needed instead of the minified full framework ones
//'web/bower_components/foundation/js/foundation.js',
//'web/bower_components/foundation/js/foundation/*.js',
// Include all Foundation 5 scripts
'web/bower_components/foundation/js/foundation.js',
'web/js/helpers/environment.js',
'web/js/helpers/supports.js',
'web/js/helpers/console.js',
'web/js/helpers/limit.js',
'web/js/helpers/notification-dispatcher.js',
'web/js/helpers/smartResize.js',
'web/js/libs/mobile/normalized.addressbar.js',
//'web/bower_components/jquery-ias/src/jquery-ias.js',
//'web/bower_components/jquery-ias/src/callbacks.js',
//'web/bower_components/jquery-ias/src/extension/spinner.js',
//'web/bower_components/jquery-ias/src/extension/noneleft.js',
//'web/js/sample_plugin.js',
'web/bower_components/foundation-datepicker/js/foundation-datepicker.js',
'web/js/scripts.js'
],
modernizrScriptFile: [
'web/bower_components/modernizr/modernizr.js'
]
},
img: {
// <%= config.img.path %>
path: 'web/images/site_assets'
},
css: {
// <%= config.css.path %>
path: 'web/css'
},
scss: {
// <%= config.scss.path %>
path: 'web/scss'
},
f5scss: {
// <%= config.f5scss.path %>
path: 'web/bower_components/foundation/scss'
},
datepicker_scss: {
// <%= config.datepicker_scss.path %>
path: 'web/bower_components/foundation-datepicker/css'
},
jstests: {
// <%= config.jstests.path %>
path: 'web/js/tests'
},
bower: {
// <%= config.bower.path %>
path: './web/bower_components'
}
}
}
};
// Load the grunt configuration
require('load-grunt-config')(grunt, options);
require('jit-grunt')(grunt);
// Load all the grunt tasks
require('load-grunt-tasks')(grunt);
/* ==========================================================================================
Available tasks:
* grunt : run sass, autoprefixer, csssplit, jshint, uglify, symfony2
* grunt watch : run sass, autoprefixer, csssplit, jshint, uglify, symfony2
* grunt jsdev : run jshint, uglify, symfony2
* grunt dev : run sass, autoprefixer, csssplit, jshint, uglify, symfony2
* grunt compileprod : run sass, autoprefixer, combine_mq, csssplit, csso, uglify
* grunt deploy : run sass, autoprefixer, combine_mq, csssplit, csso, uglify, symfony2
* grunt deployment_prod : run sass, autoprefixer, combine_mq, csssplit, csso, uglify, symfony2
* grunt setup : run bower install, sass, autoprefixer, csssplit, jshint, uglify, symfony2
* grunt first_deployment : run bower install, sass, autoprefixer, combine_mq, csssplit, csso, uglify, symfony2
* grunt runtests : run jasmine
* grunt travis : run bower install, sass, autoprefixer, combine_mq, csssplit, csso, uglify, symfony2
============================================================================================ */
/**
* GRUNT
* Default task
* run sass, autoprefixer, csssplit, jshint, uglify, symfony2
*/
// Default task
grunt.registerTask('default', [
'dev'
]);
/**
* GRUNT JSDEV
* A task for JavaScript development
* run jshint, uglify, symfony2
*/
grunt.registerTask('jsdev', [
'jshint',
'uglify:release',
'sf2-console:assetic_dump_dev'
]);
/**
* GRUNT DEV
* A task for development
* run sass, autoprefixer, csssplit, jshint, uglify, symfony2
*/
grunt.registerTask('dev', [
'jsdev',
'sass:release',
'autoprefixer:release',
'csssplit:release',
'sf2-console:assetic_dump_dev'
]);
/**
* GRUNT COMPILEPROD
* A task for your production environment
* run sass, autoprefixer, combine_mq, csssplit, csso, uglify
*/
grunt.registerTask('compileprod', [
'uglify:production',
'sass:production',
'autoprefixer:release',
'combine_mq:release',
'csssplit:release',
'csso:release'
]);
/**
* GRUNT DEPLOY
* A task for your production environment
* run sass, autoprefixer, combine_mq, csssplit, csso, uglify, symfony2
*/
grunt.registerTask('deploy', [
'compileprod',
'sf2-console:assetic_dump_dev',
'sf2-console:assetic_dump_prod'
]);
/**
* GRUNT DEPLOYMENT_PROD
* A task for your production environment
* run sass, autoprefixer, combine_mq, csssplit, csso, uglify, symfony2
*/
grunt.registerTask('deployment_prod', [
'sf2-console:cache_clear_prod',
'sf2-console:cache_warmup_prod',
'compileprod',
'sf2-console:assetic_dump_prod'
]);
/**
* GRUNT SETUP
* A task for downloading dependencies and initial build run
* run bower install, sass, autoprefixer, csssplit, jshint, uglify, symfony2
*/
grunt.registerTask('setup', [
'bower:install',
'dev'
]);
/**
* GRUNT FIRST_DEPLOYMENT
* A task for the initial setup
* run bower install, sass, autoprefixer, combine_mq, csssplit, csso, uglify, symfony2
*/
grunt.registerTask('first_deployment', [
'sf2-console:cache_clear_dev',
'sf2-console:cache_clear_prod',
'sf2-console:cache_warmup_dev',
'sf2-console:cache_warmup_prod',
'sf2-console:doctrine_schema_drop',
'sf2-console:doctrine_schema_create',
'sf2-console:doctrine_fixtures_load',
'sf2-console:sonata_media_sync_default',
'sf2-console:sonata_media_sync_intro',
'sf2-console:sonata_media_sync_bgimage',
'sf2-console:sonata_media_sync_icon',
'sf2-console:sonata_media_sync_admin',
'compileprod',
'sf2-console:assetic_dump_dev',
'sf2-console:assetic_dump_prod'
]);
/**
* GRUNT RUNTESTS
* A task for testing
* run jasmine
*/
grunt.registerTask('runtests', [
'jasmine'
]);
/**
* GRUNT TRAVIS
* A task for Travis CI to test build
* run bower install, sass, autoprefixer, combine_mq, csssplit, csso, uglify, symfony2
*/
grunt.registerTask('travis', [
'first_deployment'
]);
};