-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
31 lines (26 loc) · 831 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
"use strict";
var gulp = require('gulp');
var uglify = require('gulp-uglify');
var sourcemaps = require('gulp-sourcemaps');
var del = require('del');
var concat = require('gulp-concat');
var paths = {
scripts: ['src/js/*.js'],
build: 'piolog-cli.min.js'
};
gulp.task('clean', function (endCallback) {
// You can use multiple globbing patterns as you would with `gulp.src`
del(['build']);
endCallback();
});
gulp.task('scripts', ['clean'], function () {
// Minify and copy all JavaScript (except vendor scripts)
// with sourcemaps all the way down
return gulp.src(paths.scripts)
.pipe(sourcemaps.init())
.pipe(uglify())
.pipe(concat(paths.build))
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest('build/js'));
});
gulp.task('default', ['clean', 'scripts']);