-
Notifications
You must be signed in to change notification settings - Fork 4
/
gulpfile.js
33 lines (29 loc) · 741 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
const gulp = require('gulp');
const rename = require('gulp-rename');
const concat = require('gulp-concat');
const watch = require('gulp-watch');
const babel = require('gulp-babel');
const uglify = require('gulp-uglify');
const del = require('del');
gulp.task("concat" , ()=>{
return gulp.src("src/*.js")
.pipe(concat("lightings.js"))
.pipe(babel({
presets: ['es2015']
}))
.pipe(gulp.dest("dist"));
});
gulp.task('scripts', ["concat"], () => {
return gulp.src('dist/lightings.js')
.pipe(rename({
suffix: '.min'
}))
.pipe(uglify())
.pipe(gulp.dest('dist'));
});
gulp.task('watch', () => {
gulp.watch("src/**/*.js", ['scripts'])
});
gulp.task('clean', (cb) => {
del(['dist'], cb)
});