-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathgulpfile.js
28 lines (25 loc) · 897 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
'use strict';
const gulp = require("gulp");
const minify = require('gulp-minify');
const inject = require("gulp-inject-string");
const ts = require('gulp-typescript');
const tsProject = ts.createProject('tsconfig.json');
gulp.task('buildJs', () => {
return tsProject.src()
.pipe(tsProject())
.js.pipe(inject.replace('var ai;', ''))
.pipe(inject.prepend('window.ai = {};\n'))
.pipe(inject.replace('var __extends =', 'window.__extends ='))
.pipe(minify({ext: {min: ".min.js"}}))
.pipe(gulp.dest('./bin'));
});
gulp.task("buildDts", ["buildJs"], () => {
return tsProject.src()
.pipe(tsProject())
// .dts.pipe(inject.append('import e = framework;'))
.pipe(gulp.dest('./bin'));
});
gulp.task("build", ["buildDts"], () => {
return gulp.src('bin/**/*')
// .pipe(gulp.dest('../demo_egret/libs/framework/'))
});