-
Notifications
You must be signed in to change notification settings - Fork 13
/
GulpFile.js
49 lines (42 loc) · 1.27 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
42
43
44
45
46
47
48
49
var gulp = require('gulp'),
babel = require('gulp-babel'),
rename = require('gulp-rename'),
header = require('gulp-header'),
uglify = require('gulp-uglify');
var pkg = require('./package.json');
var banner = ['/**',
' * <%= pkg.name %> - <%= pkg.description %>',
' * @version v<%= pkg.version %>',
' * @link <%= pkg.homepage %>',
' * @license <%= pkg.license %> : https://github.com/nico3333fr/van11y-accessible-accordion-aria/blob/master/LICENSE',
' */',
''].join('\n');
gulp.task('default', ['es5'], function() {
gulp
.src(['./src/*.js', '!./src/*.es6.js'])
.pipe(gulp.dest('./dist'))
.pipe(uglify())
.pipe(rename(function (path) {
path.basename += '.min';
}))
.pipe(header(banner, { pkg : pkg } ))
.pipe(gulp.dest('./dist'));
gulp
.src('./src/*.es6.js')
.pipe(gulp.dest('./dist'));
});
gulp.task('es5', function() {
gulp
.src('./src/*.es6.js')
.pipe(babel())
.pipe(rename(function (path) {
path.basename = path.basename.replace('.es6', '');
}))
.pipe(gulp.dest('./dist'))
.pipe(rename(function (path) {
path.basename += '.min';
}))
.pipe(uglify())
.pipe(header(banner, { pkg : pkg } ))
.pipe(gulp.dest('./dist'))
});