From 9527f945e83a23c8072ff3d11fab5ede7d0c18dd Mon Sep 17 00:00:00 2001 From: taoqiufeng Date: Thu, 15 Jun 2017 17:37:17 +0800 Subject: [PATCH] add umd task --- gulpfile.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index a88ed04..8a82e05 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -14,6 +14,17 @@ gulp.task('compile-ts', () => { .pipe(gulp.dest(dest)); }); +gulp.task('compile-ts-umd', () => { + const ts = require('gulp-typescript'); + const tsProject = ts.createProject('./tsconfig.json'); + const path = require('path'); + const dest = path.join(tsProject.options.outDir, 'umd'); + tsProject.options.module = 3; + return tsProject.src() + .pipe(tsProject()) + .pipe(gulp.dest(dest)); +}); + gulp.task('watch-ts', async () => { const ts = require('gulp-typescript'); const tsProject = ts.createProject('./tsconfig.json'); @@ -35,7 +46,7 @@ gulp.task('watch-ts', async () => { gulp.task('default', (cb) => { const sequence = require('gulp-sequence'); - sequence('clean', 'compile-ts', cb); + sequence('clean', 'compile-ts', 'compile-ts-umd', cb); }); gulp.task('dev', ['watch-ts']);