-
Notifications
You must be signed in to change notification settings - Fork 23
/
gulpfile.js
34 lines (29 loc) · 913 Bytes
/
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
const gulp = require('gulp');
const webserver = require('gulp-webserver');
const del = require('del');
const webpack = require('webpack-stream');
const webpackConfig = require('./webpack.config.js');
gulp.task('clean:build', function() {
del('./web/js/*')
});
gulp.task('build', ['clean:build'], function() {
gulp.src('./index.web.js')
.pipe(webpack(webpackConfig))
.on('error', function handleError() {
this.emit('end'); // Recover from errors
})
.pipe(gulp.dest('./'));
});
gulp.task('watch', function() {
gulp.watch(['./app/**/*', './web/css/**/*', './index.web.js'], ['build']);
});
gulp.task('serve', ['watch'], function() {
gulp.src('web')
.pipe(webserver({
fallback: 'index.html',
livereload: true,
directoryListing: false,
open: true
}));
});
gulp.task('default', ['serve']);