forked from binary-com/binary-bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.babel.js
60 lines (51 loc) · 1.35 KB
/
gulpfile.babel.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
const gulp = require('gulp');
const watch = require('gulp-watch');
const ghPages = require('gulp-gh-pages');
const connect = require('gulp-connect');
const open = require('gulp-open');
require('./gulp/i18n');
require('./gulp/build');
require('./gulp/plato');
gulp.task('connect', () => {
connect.server({
root : 'www',
port : 8080,
livereload: true,
});
});
gulp.task('open', () =>
gulp.src('www/index.html').pipe(
open({
uri: 'http://localhost:8080/',
})
)
);
gulp.task('serve', ['open', 'connect'], () => {
watch(['www/*.html']).pipe(connect.reload());
});
gulp.task('deploy', ['build-min'], () =>
gulp
.src(['404.md', 'LICENSE', 'README.md', 'CNAME', './www/**', './beta/**', './translation/**', './old/**'])
.pipe(ghPages())
);
gulp.task('test-deploy', ['build-min', 'serve'], () => {});
gulp.task('watch-static', () =>
gulp.watch(
['static/xml/**/*', 'static/*.html', 'static/css/*.scss'],
{
debounceTimeout: 1000,
},
['build-dev-static']
)
);
gulp.task('watch-html', () =>
gulp.watch(
['templates/**/*'],
{
debounceTimeout: 1000,
},
['build-dev-html']
)
);
gulp.task('watch', ['serve', 'build', 'watch-static', 'watch-html']);
gulp.task('default', ['watch']);