forked from qntln/react-canvas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
38 lines (31 loc) · 863 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
35
36
37
38
var gulp = require('gulp');
var del = require('del');
var connect = require('gulp-connect');
var webpack = require('webpack-stream');
var webpackConfig = require('./webpack.config.js');
var port = process.env.PORT || 8080;
var reloadPort = process.env.RELOAD_PORT || 35729;
gulp.task('clean', function () {
del(['build']);
});
gulp.task('build', function () {
return gulp.src(webpackConfig.entry.timeline[0])
.pipe(webpack(webpackConfig))
.pipe(gulp.dest('build/'));
});
gulp.task('serve', function () {
connect.server({
port: port,
livereload: {
port: reloadPort
}
});
});
gulp.task('reload-js', function () {
return gulp.src('./build/*.js')
.pipe(connect.reload());
});
gulp.task('watch', function () {
gulp.watch(['./build/*.js'], ['reload-js']);
});
gulp.task('default', ['clean', 'build', 'serve', 'watch']);