-
Notifications
You must be signed in to change notification settings - Fork 72
/
Gruntfile.js
310 lines (307 loc) · 13.5 KB
/
Gruntfile.js
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
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
/*global module:false*/
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
// Task configuration.
jshint: {
options: {
curly: true,
eqeqeq: true,
immed: true,
latedef: true,
newcap: true,
noarg: true,
sub: true,
undef: true,
unused: true,
boss: true,
eqnull: true,
globals: {
document: true,
window: true,
console: true,
alert: true,
Image: true,
$: true,
_: true,
jQuery: true,
Shopify: true,
Currency: true
}
},
gruntfile: {
src: 'Gruntfile.js'
},
assets: {
src: ['dist/js/*.js']
}
},
uglify: {
options: {
mangle: false
},
dist: {
files: {
'theme/assets/jquery.ajax-cart.min.js': 'dist/js/jquery.ajax-cart.js',
'theme/assets/jquery.free-shipping.min.js': 'dist/js/jquery.free-shipping.js',
'theme/assets/bootstrapify-option-selection.min.js': 'dist/js/bootstrapify-option-selection.js',
'theme/assets/jquery.instagram.min.js': ['bower_components/jquery-instagram/dist/instagram.js', 'dist/js/jquery.instagram.js']
}
}
},
concat: {
dist: {
src: ['dist/js/base.js', 'dist/js/images.js', 'dist/js/facebook-gallery.js', 'dist/js/recover-password.js'],
dest: 'theme/assets/_base.js'
},
wufoo: {
src: [
'dist/scss/bootstrapify_variables.scss.liquid',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/_variables.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/mixins/_forms.scss',
'dist/scss/wufoo.scss'
],
dest: 'theme/assets/_wufoo.scss.liquid'
},
styles: {
src: [
'dist/scss/bootstrapify_mixins.scss.liquid',
'dist/scss/bootstrapify_variables.scss.liquid',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/_variables.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/mixins/_hide-text.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/mixins/_opacity.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/mixins/_image.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/mixins/_labels.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/mixins/_reset-filter.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/mixins/_resize.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/mixins/_responsive-visibility.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/mixins/_size.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/mixins/_tab-focus.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/mixins/_text-emphasis.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/mixins/_text-overflow.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/mixins/_vendor-prefixes.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/mixins/_alerts.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/mixins/_buttons.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/mixins/_panels.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/mixins/_pagination.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/mixins/_list-group.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/mixins/_nav-divider.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/mixins/_forms.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/mixins/_progress-bar.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/mixins/_table-row.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/mixins/_background-variant.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/mixins/_border-radius.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/mixins/_gradients.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/mixins/_clearfix.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/mixins/_center-block.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/mixins/_nav-vertical-align.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/mixins/_grid-framework.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/mixins/_grid.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/_normalize.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/_print.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/_glyphicons.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/_scaffolding.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/_type.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/_code.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/_grid.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/_tables.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/_forms.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/_buttons.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/_component-animations.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/_dropdowns.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/_button-groups.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/_input-groups.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/_navs.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/_navbar.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/_breadcrumbs.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/_pagination.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/_pager.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/_labels.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/_badges.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/_jumbotron.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/_thumbnails.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/_alerts.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/_progress-bars.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/_media.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/_list-group.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/_panels.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/_responsive-embed.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/_wells.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/_close.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/_modals.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/_tooltip.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/_popovers.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/_carousel.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/_utilities.scss',
'bower_components/bootstrap-sass-official/assets/stylesheets/bootstrap/_responsive-utilities.scss',
'dist/scss/bootstrapify_overrides.scss.liquid'
],
dest: 'theme/assets/_base.scss.liquid'
}
},
sass: {
dist: {
files: {
'theme/assets/checkout.css.liquid': 'dist/scss/checkout.scss'
}
}
},
copy: {
main: {
files: [
// grab js files from bower
{
expand: true,
cwd: 'bower_components/bootstrap-sass-official/assets/javascripts/bootstrap/',
src: '*.js',
dest: 'theme/assets/'
},
{
expand: true,
cwd: 'bower_components/isotope/dist/',
src: 'isotope.pkgd.min.js',
dest: 'theme/assets/'
},
{
expand: true,
cwd: 'bower_components/typeahead.js/dist/',
src: 'typeahead.js',
dest: 'theme/assets/'
},
{
expand: true,
cwd: 'bower_components/uniformThumbnails/dist/',
src: 'jquery.uniform_thumbnails.min.js',
dest: 'theme/assets/'
},
{
expand: true,
cwd: 'bower_components/jquery-zoom/',
src: 'jquery.zoom.min.js',
dest: 'theme/assets/'
},
{
expand: true,
cwd: 'bower_components/jquery-colorbox/',
src: 'jquery.colorbox-min.js',
dest: 'theme/assets/'
},
{
expand: true,
cwd: 'bower_components/orderly/dist/',
src: 'jquery.orderly.min.js',
dest: 'theme/assets/'
},
{
expand: true,
cwd: 'bower_components/jquery/dist/',
src: 'jquery.*',
dest: 'theme/assets/'
},
{
expand: true,
cwd: 'bower_components/shipping-calculator/',
src: 'jquery.cart.min.js',
dest: 'theme/assets/'
},
// grab required respond js and cross-domain files from bower
{
expand: true,
cwd: 'bower_components/respond/dest/',
src: 'respond.min.js',
dest: 'theme/assets/'
},
{
expand: true,
cwd: 'bower_components/respond/cross-domain/',
src: 'respond-proxy.html',
dest: 'theme/assets/'
}
]
}
},
shopify_theme_settings: {
settings: {
options: {
templates: ['settings/templates']
},
files: {
'theme/config/settings.html': [
'settings/branding.yml',
'settings/colour.yml',
'settings/design.yml',
'settings/layout.yml',
'settings/homepage.yml',
'settings/homepage-slider.yml',
'settings/typography.yml',
'settings/blog.yml',
'settings/products.yml',
'settings/collections.yml',
'settings/sidebar.yml',
'settings/navigation.yml',
'settings/footer.yml',
'settings/cart.yml',
'settings/age-verification.yml',
'settings/localization.yml',
'settings/money.yml',
'settings/social.yml',
'settings/advanced.yml'
]
}
}
},
compress: {
zip: {
options: {
archive: 'Bootstrapify.zip'
},
files: [{
expand: true,
cwd: './theme/',
src: ['assets/**', 'config/**', 'layout/**', 'snippets/**', 'templates/**', 'locales/**']
}]
}
},
watch: {
gruntfile: {
files: '<%= jshint.gruntfile.src %>',
tasks: ['jshint:gruntfile']
},
jshint: {
files: '<%= jshint.assets.src %>',
tasks: ['jshint:assets']
},
uglify: {
files: 'dist/js/*.js',
tasks: ['uglify']
},
concat: {
files: ['dist/js/*.js','dist/scss/*.scss*'],
tasks: ['concat']
},
sass: {
files: 'dist/scss/*.scss',
tasks: ['sass']
},
compress: {
files: ['theme/**'],
tasks: ['compress']
},
shopify_theme_settings: {
files: 'settings/*.yml',
tasks: ['shopify_theme_settings']
}
}
});
// These plugins provide necessary tasks.
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-compress');
grunt.loadNpmTasks('grunt-shopify-theme-settings');
// Default task.
grunt.registerTask('default', ['jshint', 'uglify', 'copy', 'concat', 'sass', 'shopify_theme_settings', 'compress']);
};