-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
46 lines (37 loc) · 1.14 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
const { src, dest, parallel, watch } = require('gulp');
const concat = require('gulp-concat');
const minify = require('gulp-minify');
const rename = require('gulp-rename');
const sass = require('gulp-sass');
const replace = require('gulp-replace');
const regex = /^(import|export).*;{1}$/gm;
function jsBuild() {
return src(['./src/*.js', ], {base:'./'})
.pipe(concat('calendar-view.js'))
.pipe(replace(regex, ''))
.pipe(dest('dist'))
};
function jsMinify() {
return src(['./src/*.js', ], {base:'./'})
.pipe(concat('calendar-view.js'))
.pipe(replace(regex, ''))
.pipe(minify())
.pipe(dest('dist'))
.pipe(rename('calendar-view.min.js'))
}
function sassBuild() {
return src('./src/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(dest('./dist'));
};
function sassMinify() {
return src('./src/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(dest('./dist'));
};
exports.default = parallel(sassMinify, jsMinify);
exports.minify = parallel(sassMinify, jsMinify);
exports.build = parallel(sassBuild, jsBuild);
exports.watch = function () {
watch('./src', parallel(sassBuild, jsBuild));
};