-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGulpFile.js
54 lines (36 loc) · 1 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
47
48
49
50
51
52
53
54
/**
* Created by prandutt on 7/28/2014.
*/
var gulp = require('gulp');
var usemin = require('gulp-usemin');
var path = require('path');
var uglify = require('gulp-uglify');
var typescript = require('gulp-tsc');
var rename = require('gulp-rename');
var foreach = require('gulp-foreach');
//Prod ready
gulp.task('build',['tsc'], function(){
gulp.src('dist/logger.js') // path to your files
.pipe(uglify())
.pipe(gulp.dest('dist/logger.min'));
});
//End Prod ready
//type script compiler
gulp.task('tsc', function(){
return gulp.src('src/core.ts')
.pipe(typescript({
tmpDir: '.tmp',
sourcemap: true,
out: 'logger.js',
outDir: './dist/'
}).on('error', function(a){
// Dont break the watch if compiler errors just emit to console.
}))
.pipe(gulp.dest('./dist/'));
});
//End Type script compiler
//watcher
gulp.task('default',function(){
return gulp.watch('src/*.ts',['tsc']);
});
//end watcher