-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
42 lines (34 loc) · 869 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
39
40
41
42
'use strict';
require('babel/register');
var gulp = require('gulp');
var babel = require('gulp-babel');
var combine = require('stream-combiner2');
var webpack = require('gulp-webpack');
var processJs = function() {
return combine(
babel()
);
};
gulp.task('compile-js', function() {
return gulp.src('lib/**/*.js')
.pipe(processJs());
});
gulp.task('copy', function() {
return gulp.src([
'app/*.html',
'app/*.mp3',
'vendor/*.js'
])
.pipe(gulp.dest('dist'));
});
gulp.task('webpack', function() {
return gulp.src('app/index.js')
.pipe(webpack( require('./webpack.config.js') ))
.pipe(gulp.dest('dist/'));
});
gulp.task('watch', function() {
gulp.watch('app/index.html', ['copy']);
gulp.watch('lib/**/*.js', ['webpack']);
// gulp.watch('app/**/*', ['build']);
});
gulp.task('default', ['webpack', 'copy']);