-
Notifications
You must be signed in to change notification settings - Fork 10
/
Gulpfile.js
122 lines (119 loc) · 2.45 KB
/
Gulpfile.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
/* eslint-disable */
'use strict';
const gulp = require('gulp'),
pkg = require('./package.json'),
toolkit = require('gulp-wp-toolkit');
toolkit.extendConfig({
theme: {
name: pkg.theme.name,
themeuri: pkg.homepage,
description: pkg.theme.description,
author: pkg.author,
authoruri: pkg.theme.authoruri,
version: pkg.version,
license: pkg.license,
licenseuri: pkg.theme.licenseuri,
tags: pkg.theme.tags,
textdomain: pkg.name,
domainpath: pkg.theme.domainpath,
template: 'genesis',
notes: pkg.theme.notes,
},
js: {
'letters': [
'develop/js/a.js',
'develop/js/b.js',
'develop/js/c.js',
],
'numbers': [
'develop/js/1.js',
'develop/js/2.js',
],
'standalone': [
'develop/js/standalone.js',
],
},
server: {
proxy: 'example.dev',
online: true,
},
src: {
zipuser: [
'images/*',
'includes/**/*',
'includes-vendors/**/*',
'js/*',
'languages/*',
'front-page.php',
'functions.php',
'LICENSE.md',
'page_landing.php',
'readme.txt',
'screenshot.png',
'style*',
],
zipdev: [
'develop/images/*',
'develop/js/*',
'develop/languages/*',
'develop/scss/**/*',
'images/*',
'includes/**/*',
'includes-vendors/**/*',
'js/*',
'languages/*',
'CHANGELOG.md',
'composer.json',
'composer.lock',
'front-page.php',
'functions.php',
'Gulpfile.js',
'LICENSE.md',
'package.json',
'page_landing.php',
'readme.txt',
'README.md',
'screenshot.png',
'style*',
],
},
css: {
basefontsize: 16, // Used by postcss-pxtorem.
cssnano: {
discardComments: {
removeAll: true
},
zindex: false,
},
remreplace: false, // Used by postcss-pxtorem.
remmediaquery: true, // Used by postcss-pxtorem.
scss: {
'editor-style': {
src: 'develop/scss/editor.scss',
dest: './',
outputStyle: 'compressed',
},
},
},
});
toolkit.extendTasks(gulp, {
// Task Name.
console: [
['build'],
function() {
console.log('This is an extended task. It depends on `build`');
},
],
'lint:php': [['lint:phpcs']], // How not to run lint:phpmd.
'zip': [['zipuser', 'zipdev']],
'zipuser': function() {
return gulp.src(toolkit.config.src.zipuser, {base: './'}).
pipe(zip(pkg.name + '-' + pkg.version + '.zip')).
pipe(gulp.dest('dist'));
},
'zipdev': function() {
return gulp.src(toolkit.config.src.zipdev, {base: './'}).
pipe(zip(pkg.name + '-developer-' + pkg.version + '.zip')).
pipe(gulp.dest('dist'));
},
});