-
Notifications
You must be signed in to change notification settings - Fork 0
/
wpgulp.config.js
199 lines (166 loc) · 4.57 KB
/
wpgulp.config.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
/**
* WPGulp Configuration File
*
* 1. Edit the variables as per your project requirements.
* 2. In paths you can add <<glob or array of globs>>.
*
* @package WPGulp
*/
// Project options.
// Local project URL of your already running WordPress site.
// > Could be something like "wpgulp.local" or "localhost"
// > depending upon your local WordPress setup.
const projectURL = 'wpsite';
const pluginName = 'ppv-ngg';
// Theme/Plugin URL. Relative path from source to WordPress plugins.
const WPpluginFolder = '../wpsite/wp-content/plugins/';
const pluginFolder = WPpluginFolder + pluginName;
const browserAutoOpen = false;
const injectChanges = true;
// >>>>> Main Style options.
// Path to main .scss file.
const styleMainSRC = './assets/scss/main/ppv-ngg-main.scss';
// Path to place the compiled main CSS file.
const styleMainDEST = pluginFolder + '/assets/css/';
// >>>>> Multiple Style options.
// Path to .scss files.
const styleMultiSRC = './assets/scss/multi/*.scss';
// Path to place the compiled Multiple CSS files.
const styleMultiDEST = pluginFolder + '/assets/css/';
// Available options → 'compact' or 'compressed' or 'nested' or 'expanded'
const outputStyle = 'expanded';
const errLogToConsole = true;
const precision = 10;
// JS Main options.
// Path to JS Main folder.
const jsMainSRC = './assets/js/main/*.js';
// Path to place the compiled JS Admin file.
const jsMainDEST = pluginFolder + '/assets/js/';
// Compiled JS Admin file name. Example set to custom i.e. custom.js.
const jsMainFile = 'ppv-ngg-main';
// JS Multi options which are not concatenated.
// Path to JS Public vendor files.
const jsMultiSRC = './assets/js/multi/*.js';
// Path to place the compiled JS Public vendors file.
const jsMultiDEST = pluginFolder + '/assets/js/';
// >>>>> Other file paths.
// Path to PHP files.
const phpSRC = [
'./**/*.php',
'!node_modules/**/*'
];
// Path to place PHP files.
const phpDEST = pluginFolder;
// Miscellaneous files.
const miscGlob = [
'./**',
'!./{node_modules,node_modules/**/*}',
'!./{dist,dist/**/*}',
'!./.git',
'!./.svn',
'!./gulpfile.babel.js',
'!./wpgulp.config.js',
'!./.eslintrc.js',
'!./.eslintignore',
'!./.editorconfig',
'!./phpcs.xml.dist',
'!./vscode',
'!./package.json',
'!./package-lock.json',
'!./**/*.php',
'!./{admin,admin/**/*}',
'!./{public,public/**/*}',
'!./{includes,includes/**/*}',
'!./{(assets/js,assets/js/**/*}',
'!./{assets/scss,assets/scss/**/*}'
];
// Path to place miscellaneous files.
const miscDEST = pluginFolder;
// Non-processed vendor JS
const vendorJsSRC = [
'./node_modules/justifiedGallery/dist/js/*.js',
'./node_modules/simplelightbox/dist/*.js'
];
// Path to place non-processed vendor JS files.
const vendorJsDEST = pluginFolder + '/assets/js/';
// Readme text file location.
const readmeSRC = './README.txt';
// Path of markdown file.
const readmeDEST = '.';
// >>>>> Watch files paths.
// Path to all *.scss files inside css folder and inside them.
const watchStyles = [
'./assets/scss/**/*.scss'
];
// Path to all *.js files.
const watchJs = [
'./assets/js/**/*.js'
];
// Path to all PHP files.
const watchPhp = phpSRC;
// Path to all miscellaneous files.
const watchMisc = [
'./assets/images/**/*',
'./languages/**/*',
'./*.md',
'./*.txt'
];
// >>>>> Zip file config.
// Must have.zip at the end.
const zipName = pluginName + '.zip';
// Path to WordPress plugin folder.
const zipSRC = WPpluginFolder + pluginName + '/**';
// Must be a folder outside of the zipped folder.
const zipDEST = './dist'; // Folder to put Zip file in
// Browsers you care about for auto-prefixing. Browserlist https://github.com/ai/browserslist
// The following list is set as per WordPress requirements. Though; Feel free to change.
const BROWSERS_LIST = [
'>= 1%',
'last 1 major version',
'not dead',
'Chrome >= 45',
'Firefox >= 38',
'Edge >= 12',
'Explorer >= 11',
'iOS >= 9',
'Safari >= 9',
'Android >= 4.4',
'Opera >= 30'
];
// Export.
module.exports = {
projectURL,
pluginName,
WPpluginFolder,
pluginFolder,
browserAutoOpen,
injectChanges,
styleMainSRC,
styleMainDEST,
styleMultiSRC,
styleMultiDEST,
outputStyle,
errLogToConsole,
precision,
jsMainSRC,
jsMainDEST,
jsMainFile,
jsMultiSRC,
jsMultiDEST,
phpSRC,
phpDEST,
miscGlob,
miscDEST,
readmeSRC,
readmeDEST,
vendorJsSRC,
vendorJsDEST,
watchStyles,
watchJs,
watchPhp,
watchMisc,
zipName,
zipSRC,
zipDEST,
BROWSERS_LIST
};