forked from CharltonC/chrome-custom-code-injector
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
53 lines (49 loc) · 2 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
const gulp = require('gulp');
const { $ } = require('./gulp/common');
gulp.task('build-html', require('./gulp/html-pug/task'));
gulp.task('build-css', require('./gulp/css/task'));
// gulp.task('build-img', require('./gulp/img-sprite/task'));
gulp.task('build-ts:lint', require('./gulp/ts-lint/task'));
gulp.task('build-ts:compile', require('./gulp/ts-compile/task'));
gulp.task('build-ts', gulp.series('build-ts:lint'), done => done());
gulp.task('clean', require('./gulp/util-clean/task'));
gulp.task('ver-check', require('./gulp/util-ver-check/task'));
gulp.task('ver-bump', require('./gulp/util-ver-bump/task'));
gulp.task('zip', require('./gulp/util-zip/task'));
gulp.task('wait', require('./gulp/util-wait/task'));
gulp.task('copy', require('./gulp/util-copy/task'));
gulp.task('build-copy', gulp.series('copy', 'wait'), done => { done(); });
/**
* Watch files + Optionally Start a local server (if `startIdxPage` is specified)
*
* CMD: `gulp watch [--files=[html|ts|css]]? [--startIdxPage=<indexPageName>]?`
* @param: files - which category of files to watch (ts files only trigger lint and test tasks)
* @param: indexPageName - starting index page at the output folder, e.g. option | poup
* @param: startIdxPage - starts a local server
*/
gulp.task('watch', require('./gulp/util-browsersync/task'));
/**
* Build + Watch TS files (dev mode or prod+watchify mode)
*
* CMD: `gulp build [--prod --watchify?]?`
* @param: prod - production mode (incl. optimization)
* @param: watchify - include file watch + build caching for production mode
*/
gulp.task(
'build',
gulp.series('clean', 'build-html', 'build-css', 'build-ts', 'build-copy', 'ver-check'),
done => done()
);
/**
* Build + Watch files + Optionally Start a local server (if `startIdxPage` is specified)
*
* CMD: `gulp serve [--prod --watchify?]? [--startIdxPage=<indexPageName>]?`
* @param: prod - as abv
* @param: watchify - as abv
* @param: startIdxPage - as abv
*/
gulp.task(
'serve',
gulp.series('build', 'watch'),
done => done()
);