-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
45 lines (39 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
var gulp = require('gulp'),
rename = require('gulp-rename'),
del = require('del'),
ts = require('gulp-typescript'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify');
var src = './src',
build = './build',
dist = './dist',
p9js = 'p9.js',
p9min = 'p9.min.js';
gulp.task('build', ['build:min'], function () {
return console.log("COMPLETED");
})
gulp.task('clean', function(){
return del([build, dist]);
})
gulp.task('build:concat', ['build:full'], function () {
return gulp.src(build + '/**/*.js')
.pipe(gulp.dest(dist));
})
gulp.task('build:full', ['clean'], function () {
return gulp.src([src + '/**/*.ts'])
.pipe(ts({
declaration: false,
removeComments: true,
target: "ES5",
module: "amd",
noImplicitAny: false,
outFile: p9js
}))
.pipe(gulp.dest(build));
})
gulp.task('build:min', ['build:concat'], function () {
return gulp.src(dist + '/' + p9js)
.pipe(uglify())
.pipe(rename(p9min))
.pipe(gulp.dest(dist));
})