-
Notifications
You must be signed in to change notification settings - Fork 58
/
gulpfile.js
46 lines (42 loc) · 1.13 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
var gulp = require('gulp')
var ts = require('gulp-typescript')
var del = require('del')
var fileLoader = require('gulp-file-loader')
var rename = require('gulp-rename')
function compileTS(dir, esModule) {
var tsProject = ts.createProject('tsconfig.json', { module: esModule ? 'ES2015' : 'CommonJS' })
return tsProject
.src()
.pipe(tsProject())
.pipe(gulp.dest(dir))
}
function styles() {
return gulp
.src(['./src/components/**/*.scss'])
.pipe(gulp.dest('es'))
.pipe(gulp.dest('lib'))
}
function fonts() {
return gulp
.src([
'./src/components/**/*.eot',
'./src/components/**/*.svg',
'./src/components/**/*.ttf',
'./src/components/**/*.woff',
'./src/components/**/*.woff2',
'./src/components/**/*.otf'
])
.pipe(gulp.dest('es'))
.pipe(gulp.dest('lib'))
}
function compileES() {
return compileTS('es', true)
}
function compileCJS() {
// return gulp.parallel(() => compileTS('lib', false), styles)
return compileTS('lib', false)
}
function clean() {
return del(['es', 'lib'])
}
exports.default = gulp.series(clean, styles, gulp.parallel(compileCJS, compileES, fonts))