forked from mjc-gh/style.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGulpfile.babel.js
34 lines (28 loc) · 912 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
import gulp from 'gulp';
import clean from 'gulp-clean';
import concat from 'gulp-concat';
import rename from 'gulp-rename';
import uglify from 'gulp-uglify';
import qunit from 'gulp-qunit';
gulp.task('clean', () => {
let read = false;
return gulp.src('dist/*.js', { read }).
pipe(clean());
});
gulp.task('concat', ['clean'], () => {
return gulp.src(['src/_intro.js', 'src/main.js', 'src/_outro.js']).
pipe(concat('style.js')).
pipe(gulp.dest('dist/'));
});
gulp.task('compress', ['clean', 'concat'], () => {
return gulp.src('dist/style.js').
pipe(uglify()).
pipe(rename((path) => { path.basename = `${path.basename}.min` })).
pipe(gulp.dest('dist/'));
});
gulp.task('test', () => {
return gulp.src('test/all.html').
pipe(qunit());
});
gulp.task('build', ['clean', 'concat', 'compress']);
gulp.task('default', ['build', 'test']);