-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
54 lines (43 loc) · 1.27 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
/* jshint node: true */
/* jshint esversion: 6 */
"use strict";
const Gulp = require('gulp'),
TSC = require('gulp-typescript'),
TSDoc = require('gulp-typedoc'),
SourceMaps = require('gulp-sourcemaps'),
Inject = require('gulp-inject'),
Concat = require('gulp-concat'),
Uglify = require('gulp-uglify'),
Browserify = require('browserify'),
TSify = require('tsify'),
VSS = require('vinyl-source-stream'),
VBuffer = require('vinyl-buffer')
;
let sources = "./src/*.ts";
let tsProject = TSC.createProject("./tsconfig.json");
Gulp.task('ts:compile', _ => {
var script = Browserify().add('src/image.ts').plugin('tsify', {
target: 'es3',
module: 'commonjs'
})
.bundle();
script.pipe(VSS("assetzen.js"))
.pipe(Gulp.dest('dist/'));
script.pipe(VSS("assetzen.min.js"))
.pipe(VBuffer())
.pipe(Uglify({mangle: true}))
.pipe(Gulp.dest('dist/'));
});
Gulp.task('ts:doc', _ => {
return Gulp.src(sources).pipe(TSDoc({
module: 'commonjs',
out: "./doc",
json: "./dist/docs.json",
name: "AssetZen.js",
version: true
}));
});
// Default Task
Gulp.task('default', ['ts:compile']);
Gulp.task('watch', ['ts:compile'], _ => {
});