-
Notifications
You must be signed in to change notification settings - Fork 4
/
gulpfile.js
44 lines (39 loc) · 1008 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
42
43
44
const { src, dest, series, watch } = require('gulp');
const concat = require('gulp-concat');
const uglify = require('gulp-uglify');
const replace = require('gulp-replace');
const regex = /^(import|export).*;{1}$/gm;
function jsBuild(){
return src([
'./src/mixin/*.js',
'./src/calendar/*.js',
'./src/formatter/*.js',
'./src/parser/*.js',
'./src/lang/*.js',
'./src/*.js'
], {base:'./'})
.pipe(concat('pasoonate.js'))
.pipe(replace(regex, ''))
.pipe(dest('browser'))
}
function jsMinify(){
return src([
'./src/mixin/*.js',
'./src/calendar/*.js',
'./src/formatter/*.js',
'./src/parser/*.js',
'./src/lang/*.js',
'./src/*.js'
], {base:'./'})
.pipe(concat('pasoonate.min.js'))
.pipe(replace(regex, ''))
.pipe(uglify())
.pipe(dest('browser'));
}
function watching() {
watch('./src', null, series(jsBuild));
}
exports.minify = jsMinify;
exports.build = jsBuild;
exports.default = series(jsMinify);
exports.watch = watching;