-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgulpfile.js
50 lines (39 loc) · 1.01 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
const fs = require('fs');
const browserSync = require('browser-sync').create();
const gulp = require('gulp');
const readme = require('gulp-readme-to-markdown');
const merge = require('merge');
let config = {
packagesPath: './node_modules',
sync: false,
syncTarget: 'http://localhost/wordpress/'
};
/* eslint-disable no-sync */
if (fs.existsSync('./gulp-config.json')) {
const overrides = JSON.parse(fs.readFileSync('./gulp-config.json'));
config = merge(config, overrides);
}
/* eslint-enable no-sync */
//
// Documentation
//
// Generates a README.md from README.txt
gulp.task('readme', () => {
return gulp.src('readme.txt')
.pipe(readme({
details: false,
screenshot_ext: [] // eslint-disable-line camelcase
}))
.pipe(gulp.dest('.'));
});
//
// Rerun tasks when files change
//
gulp.task('watch', (done) => {
serverServe(done);
gulp.watch('./**/*.php', gulp.series(serverReload));
});
//
// Default task
//
gulp.task('default', gulp.series('readme'));