-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.babel.js
41 lines (37 loc) · 891 Bytes
/
gulpfile.babel.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
/**
* Created by hkx on 2016/12/30.
*/
'use strict';
import gulp from 'gulp';
import gulpTS from 'gulp-typescript';
import browserSync from 'browser-sync';
import chalk from 'chalk';
import path from 'path';
import config from './config.json';
const DEPLOY = {
PORT : 3333,
LOCALHOST (){
return `localhost:${this.PORT}`;
}
};
gulp.task('compile-ts', () => {
return gulp
.src(config.compileTsPath)
.pipe(gulpTS({
target: 'ES6',
module: 'commonjs',
moduleResolution: 'node',
sourceMap: true,
noImplicitAny: true
}))
.pipe(gulp.dest(config.buildTsPath));
});
gulp.task('reload',()=>{
browserSync.init({
proxy : DEPLOY.LOCALHOST(),
port : DEPLOY.PORT + 1
});
gulp.watch(config.watchViewTemplate,(event)=>{
console.log(`reload views pug : ${chalk.white.bgMagenta.bold(path.basename(event.path))}`);
}).on('change',browserSync.reload);
});