-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
30 lines (25 loc) · 852 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
var gulp = require('gulp');
var gulpLoadPlugins = require('gulp-load-plugins');
var del = require('del');
var $ = gulpLoadPlugins();
gulp.task('build:full', function () {
return gulp.src('src/**/*.js')
.pipe($.plumber())
.pipe($.sourcemaps.init())
.pipe($.babel())
.pipe($.sourcemaps.write('.'))
.pipe(gulp.dest('dist'));
});
gulp.task('build:min', function () {
return gulp.src('src/**/*.js')
.pipe($.plumber())
.pipe($.sourcemaps.init())
.pipe($.babel())
.pipe($.uglify({ 'preserveComments': 'license' }))
.pipe($.rename({ suffix: '.min' }))
.pipe($.sourcemaps.write('.'))
.pipe(gulp.dest('dist'));
});
gulp.task('build', ['build:full', 'build:min']);
gulp.task('clean', del.bind(null, ['dist/*']));
gulp.task('default', ['clean', 'build']);