-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
39 lines (34 loc) · 882 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
const {src, dest, watch} = require('gulp');
const concat = require('gulp-concat');
const minify = require('gulp-minify');
const ts = require('gulp-typescript');
const sass = require('gulp-sass');
const tsProject = ts.createProject('tsconfig.json');
function compile_ts(){
return src('src/*.ts')
.pipe(tsProject())
.pipe(concat('zed.js'))
.pipe(minify())
.pipe(dest('lib/'))
}
function compile_sass() {
return src('src/*.scss')
.pipe(sass().on('error', sass.logError))
.pipe(minify())
.pipe(dest('lib/'))
}
function pack_js() {
return src(['lib/*.js'])
.pipe(concat('zed.js'))
.pipe(dest('lib/'));
};
function pack_css() {
return src(['lib/*.css'])
.pipe(concat('zed.css'))
.pipe(dest('lib/'));
}
exports.default = function () {
watch('src/*.scss', compile_sass);
watch('src/*.css', pack_css);
watch('src/*.js', pack_js);
};