-
-
Notifications
You must be signed in to change notification settings - Fork 15
/
gulpfile.js
41 lines (37 loc) · 1.07 KB
/
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
const gulp = require('gulp');
const babel = require('gulp-babel');
const uglify = require('gulp-uglify');
const rename = require("gulp-rename");
const header = require('gulp-header');
const pkg = require('./package.json');
const banner = [
'/*! <%= pkg.name %> v<%= pkg.version %>',
' (c) <%= new Date().getFullYear() %> <%= pkg.author %> <%= pkg.homepage %>',
' */\n'].join('');
gulp.task('es5-minify', () =>
gulp.src('src/gandul.js')
.pipe(babel({
presets: ['@babel/preset-env']
}))
.pipe(uglify())
.pipe(header(banner, { pkg : pkg } ))
.pipe(rename('gandul.min.js'))
.pipe(gulp.dest('dist'))
);
gulp.task('es5', () =>
gulp.src('src/gandul.js')
.pipe(babel({
presets: ['@babel/preset-env']
}))
.pipe(uglify({
output: {
comments: false,
beautify: true
},
mangle: false,
compress: false
}))
.pipe(header(banner, { pkg : pkg } ))
.pipe(gulp.dest('dist'))
);
gulp.task('default', gulp.series('es5', 'es5-minify'));