forked from overbool/poster
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.babel.js
40 lines (36 loc) · 889 Bytes
/
gulpfile.babel.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
const gulp = require('gulp')
const concat = require('gulp-concat')
const uglify = require('gulp-uglify')
const babel = require('gulp-babel')
const header = require('gulp-header')
const pkg = require('./package.json')
const banner = [
'/*! ',
'<%= package.name %> ',
'v<%= package.version %> | ',
'(c) ' + new Date().getFullYear() + ' <%= package.author %> |',
' <%= package.homepage %>',
' */',
'\n'
].join('');
gulp.task('js', () => {
return gulp.src('src/*.js')
.pipe(babel({
presets: ['@babel/env']
}))
.pipe(concat('poster.js'))
.pipe(header(banner, {
package: pkg
}))
.pipe(gulp.dest('dist/'))
.pipe(uglify())
.pipe(concat('poster.min.js'))
.pipe(header(banner, {
package: pkg
}))
.pipe(gulp.dest('dist/'))
});
gulp.watch('src/**/*.js', function(e) {
gulp.start('js')
})
gulp.task('default', ['js'])