-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
42 lines (34 loc) · 855 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
var babel = require('gulp-babel');
var concat = require('gulp-concat');
var gulp = require('gulp');
var server = require('gulp-server-livereload');
var paths = {
babel: ['./src/**/*.js'],
concat: ['./dist/**/*.js']
};
gulp.task('babel', function () {
return gulp.src(paths.babel)
.pipe(babel({
presets: ['es2015']
}))
.pipe(gulp.dest('dist'))
});
gulp.task('concat', function () {
return gulp.src(paths.concat)
.pipe(concat('app.min.js'))
.pipe(gulp.dest('./'));
});
gulp.task('livereload', function() {
gulp.src('')
.pipe(server({
livereload: true,
defaultFile: 'index.html',
derectoryListing: false,
open: false
}));
});
gulp.task("watch", function() {
gulp.watch(paths.babel, ["babel"]);
gulp.watch(paths.concat, ["concat"]);
});
gulp.task("default", ["livereload"]);