@@ -29,14 +29,13 @@ module.exports = function(grunt) {
29
29
} ,
30
30
watch : {
31
31
assemble : {
32
- files : '<%= config.src %>/{content,data,templates}/{,*/} *.{md,hbs,yml,json}' ,
32
+ files : '<%= config.src %>/{content,data,templates}/**/ *.{md,hbs,yml,json}' ,
33
33
tasks : [ 'assemble' ]
34
34
} ,
35
35
css : {
36
36
files : '<%= config.src %>/assets/css/*.css' ,
37
37
tasks : [
38
38
'concat:dist' ,
39
- // 'uncss',
40
39
'postcss'
41
40
]
42
41
} ,
@@ -87,7 +86,10 @@ module.exports = function(grunt) {
87
86
helpers : [ '<%= config.src %>/assets/js/translation.js' ] ,
88
87
assets : '<%= config.dist %>/assets' ,
89
88
layout : '<%= config.src %>/templates/layouts/default.hbs' ,
90
- data : [ '<%= config.src %>/data/**/*.{json,yml}' , '!<%= config.src %>/data/reference/*.json' ] ,
89
+ data : [
90
+ '<%= config.src %>/data/**/*.{json,yml}' ,
91
+ '!<%= config.src %>/data/reference/*.json'
92
+ ] ,
91
93
partials : '<%= config.src %>/templates/partials/*.hbs' ,
92
94
plugins : [
93
95
'assemble-contrib-permalinks' ,
@@ -121,7 +123,7 @@ module.exports = function(grunt) {
121
123
}
122
124
} ,
123
125
dest : '<%= config.dist %>' ,
124
- src : " !*.*"
126
+ src : ' !*.*'
125
127
}
126
128
} ,
127
129
@@ -161,7 +163,7 @@ module.exports = function(grunt) {
161
163
// CSS:
162
164
concat : {
163
165
options : {
164
- separator : ';' ,
166
+ separator : ';'
165
167
} ,
166
168
dist : {
167
169
src : [
@@ -174,21 +176,20 @@ module.exports = function(grunt) {
174
176
} ,
175
177
postcss : {
176
178
options : {
177
- map : true ,
178
179
map : {
179
180
inline : false ,
180
181
annotation : '<%= config.dist %>/assets/css/maps/'
181
182
} ,
182
183
processors : [
183
184
require ( 'autoprefixer' ) ( { browsers : [
184
- " Android 2.3" ,
185
- " Android >= 4" ,
186
- " Chrome >= 20" ,
187
- " Firefox >= 24" ,
188
- " Explorer >= 8" ,
189
- " iOS >= 6" ,
190
- " Opera >= 12" ,
191
- " Safari >= 6"
185
+ ' Android 2.3' ,
186
+ ' Android >= 4' ,
187
+ ' Chrome >= 20' ,
188
+ ' Firefox >= 24' ,
189
+ ' Explorer >= 8' ,
190
+ ' iOS >= 6' ,
191
+ ' Opera >= 12' ,
192
+ ' Safari >= 6'
192
193
] } ) ,
193
194
require ( 'cssnano' ) ( )
194
195
]
@@ -227,7 +228,7 @@ module.exports = function(grunt) {
227
228
examples : {
228
229
expand : true ,
229
230
cwd : '<%= config.src %>/data/examples' ,
230
- src : [ '**' , '!build_examples/**' ] ,
231
+ src : [ '**' , '!build_examples/**' ] ,
231
232
dest : '<%= config.dist %>/assets/examples'
232
233
} ,
233
234
contributor_docs : {
@@ -307,7 +308,7 @@ module.exports = function(grunt) {
307
308
default_options : {
308
309
files : [
309
310
{
310
- prepend : " referenceData = " ,
311
+ prepend : ' referenceData = ' ,
311
312
input : '<%= config.src %>/templates/pages/reference/data.json' ,
312
313
output : '<%= config.src %>/offline-reference/js/data.js'
313
314
}
@@ -325,28 +326,32 @@ module.exports = function(grunt) {
325
326
src : [ '**/*' ] ,
326
327
dest : 'p5-reference/'
327
328
}
328
- } ,
329
+ } ,
329
330
htmllint : {
330
331
all : {
331
- src : [ '<%= config.dist %>/**/*.html' ,
332
- '!<%= config.dist %>/es/**/*.html' ,
333
- '!<%= config.dist %>/zh-Hans/**/*.html' ,
334
- '!<%= config.dist %>/**/CHANGES.html' ,
335
- '!<%= config.dist %>/**/README.html' ,
336
- '!<%= config.dist %>/**/p5_featured/**/*.html' ,
337
- '!<%= config.dist %>/**/learn/*.html' ,
338
- '!<%= config.dist %>/**/examples/*.html' ,
339
- '!<%= config.dist %>/reference/assets/index.html' ] ,
332
+ src : [
333
+ '<%= config.dist %>/**/*.html' ,
334
+ '!<%= config.dist %>/es/**/*.html' ,
335
+ '!<%= config.dist %>/zh-Hans/**/*.html' ,
336
+ '!<%= config.dist %>/**/CHANGES.html' ,
337
+ '!<%= config.dist %>/**/README.html' ,
338
+ '!<%= config.dist %>/**/p5_featured/**/*.html' ,
339
+ '!<%= config.dist %>/**/learn/*.html' ,
340
+ '!<%= config.dist %>/**/examples/*.html' ,
341
+ '!<%= config.dist %>/reference/assets/index.html'
342
+ ] ,
340
343
options : {
341
- ignore : [ / ^ T h i s d o c u m e n t a p p e a r s t o b e w r i t t e n i n E n g l i s h / ,
342
- / ^ B a d v a l u e “ h t t p s : / ,
343
- / ^ C o n s i d e r a d d i n g a “ l a n g ” a t t r i b u t e t o t h e “ h t m l ” / ]
344
+ ignore : [
345
+ / ^ T h i s d o c u m e n t a p p e a r s t o b e w r i t t e n i n E n g l i s h / ,
346
+ / ^ B a d v a l u e “ h t t p s : / ,
347
+ / ^ C o n s i d e r a d d i n g a “ l a n g ” a t t r i b u t e t o t h e “ h t m l ” /
348
+ ]
344
349
}
345
350
}
346
351
}
347
352
} ) ;
348
353
349
- grunt . registerTask ( 'update-version' , function ( ) {
354
+ grunt . registerTask ( 'update-version' , function ( ) {
350
355
const done = this . async ( ) ;
351
356
352
357
const version = require ( './src/templates/pages/reference/data.json' ) . project . version ;
@@ -386,14 +391,13 @@ module.exports = function(grunt) {
386
391
grunt . registerTask ( 'optimize' , [
387
392
'newer:imagemin' ,
388
393
'concat:dist' ,
389
- // 'uncss',
390
394
'postcss'
391
395
] ) ;
392
396
393
397
// i18n tracking task
394
- grunt . registerTask ( 'i18n' , function ( ) {
398
+ grunt . registerTask ( 'i18n' , function ( ) {
395
399
var done = this . async ( ) ;
396
- require ( " ./i18n.js" ) ( done ) ;
400
+ require ( ' ./i18n.js' ) ( done ) ;
397
401
} ) ;
398
402
399
403
// runs tasks in order
@@ -412,8 +416,5 @@ module.exports = function(grunt) {
412
416
] ) ;
413
417
414
418
// runs with just grunt command
415
- grunt . registerTask ( 'default' , [
416
- 'build'
417
- ] ) ;
418
-
419
+ grunt . registerTask ( 'default' , [ 'build' ] ) ;
419
420
} ;
0 commit comments