-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwpeg.config.js
71 lines (57 loc) · 1.89 KB
/
wpeg.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
// eslint-disable-next-line import/no-extraneous-dependencies
const pkg = require( 'json-file' ).read( './package.json' ).data;
const cfg = {};
// Build Paths.
cfg.name = 'lzb-select-dynamic';
cfg.src = './src';
cfg.dist_root = './dist';
cfg.dist = '{dist_root}/{name}';
// Template variables that will be automatically replaced.
cfg.template_files_src = '{dist}/**/*.{md,php,js,css,pot,json}';
cfg.template_files_variables = {
text_domain: pkg.name,
plugin_version: pkg.version,
plugin_name: pkg.name,
plugin_title: pkg.title,
plugin_author: pkg.author,
};
// Copy files.
cfg.copy_files_src = [
'{src}/**/*',
'!{src}/**/*.{js,jsx,scss}',
'{src}/**/vendor/**/*.{js,jsx,scss}',
];
// Compile SCSS files.
cfg.compile_scss_files_src = [
'{src}/**/*.scss',
'!{src}/**/vendor/**/*',
];
// Compile JSX files.
cfg.compile_jsx_files_src = [ '{src}/*assets/js/select-dynamic.jsx' ];
// Correct line endings files.
cfg.correct_line_endings_files_src = '{dist}/**/*.{js,css}';
// Translate PHP files.
cfg.translate_php_files_src = '{dist}/**/*.php';
cfg.translate_php_files_dist = `{dist}/languages/${ cfg.template_files_variables.plugin_name }.pot`;
cfg.translate_php_options = {
domain: cfg.template_files_variables.text_domain,
package: cfg.template_files_variables.plugin_title,
lastTranslator: cfg.template_files_variables.plugin_author,
team: cfg.template_files_variables.plugin_author,
};
// ZIP files.
cfg.zip_files = [
{
src: '{dist}/**/*',
src_opts: {
base: '{dist_root}',
},
dist: '{dist_root}/{name}.zip',
},
];
// Watch files.
cfg.watch_files = [ '{src}/**/*', '!{src}/**/*.{jsx,js,scss}' ];
cfg.watch_js_files = [ '{src}/**/*.js', '!{src}/*vendor/**/*' ];
cfg.watch_jsx_files = [ '{src}/**/*.jsx', '{src}/**/*.scss', '!{src}/*vendor/**/*' ];
cfg.watch_scss_files = '{src}/**/*.scss';
module.exports = cfg;