-
Notifications
You must be signed in to change notification settings - Fork 5
/
gulpfile.js
41 lines (35 loc) · 968 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
34
35
36
37
38
39
40
41
'use strict';
var babel = require('gulp-babel');
var concat = require('gulp-concat');
var del = require('del');
var gulp = require('gulp');
var rename = require('gulp-rename');
var minify = require('gulp-minify');
gulp.task('clean', function(done) {
del('dist').then(function() {
done();
});
});
gulp.task('build:single', ['clean'], function() {
return gulp.src('src/HTML2IncDom.js')
.pipe(babel({
plugins: ['transform-es2015-modules-umd'],
presets: ['es2015']
}))
.pipe(rename('html2incdom.js'))
.pipe(gulp.dest('dist'));
});
gulp.task('build:withParser', ['build:single'], function() {
return gulp.src(['src/HTMLParser.js', 'dist/html2incdom.js'])
.pipe(concat('html2incdom-withParser.js'))
.pipe(gulp.dest('dist'));
});
gulp.task('build', ['build:withParser'], function() {
return gulp.src('dist/*.js')
.pipe(minify({
preserveComments: 'some',
output: {}
}))
.pipe(gulp.dest('dist'));
});
gulp.task('default', ['build']);