-
Notifications
You must be signed in to change notification settings - Fork 33
/
gulpfile.js
28 lines (21 loc) · 996 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
var gulp = require('gulp')
const terser = require('gulp-terser')
var ts = require('gulp-typescript')
const imagemin = require('gulp-imagemin')
var tsProject = ts.createProject('tsconfig.json')
gulp.task('copy', async function () {
gulp.src('./src/public/fonts/*').pipe(gulp.dest('./dist/public/fonts'))
gulp.src('./src/public/stylesheets/*.css').pipe(gulp.dest('./dist/public/stylesheets'))
gulp.src('./src/views/*.ejs').pipe(gulp.dest('./dist/views'))
})
gulp.task('uglify', async function () {
gulp.src('./src/public/scripts/*.js').pipe(terser()).pipe(gulp.dest('./dist/public/scripts'))
})
gulp.task('compress-img', async function () {
gulp.src('./src/public/images/*').pipe(imagemin()).pipe(gulp.dest('./dist/public/images'))
})
gulp.task('ts-compile', function () {
return tsProject.src().pipe(tsProject()).js.pipe(gulp.dest('dist'))
})
gulp.task('build', gulp.series('copy', 'uglify', 'compress-img', 'ts-compile'))
gulp.task('default', gulp.series('build'))