Skip to content

Commit 9527f94

Browse files
author
taoqiufeng
committed
add umd task
1 parent 9fcf7fe commit 9527f94

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

gulpfile.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,17 @@ gulp.task('compile-ts', () => {
1414
.pipe(gulp.dest(dest));
1515
});
1616

17+
gulp.task('compile-ts-umd', () => {
18+
const ts = require('gulp-typescript');
19+
const tsProject = ts.createProject('./tsconfig.json');
20+
const path = require('path');
21+
const dest = path.join(tsProject.options.outDir, 'umd');
22+
tsProject.options.module = 3;
23+
return tsProject.src()
24+
.pipe(tsProject())
25+
.pipe(gulp.dest(dest));
26+
});
27+
1728
gulp.task('watch-ts', async () => {
1829
const ts = require('gulp-typescript');
1930
const tsProject = ts.createProject('./tsconfig.json');
@@ -35,7 +46,7 @@ gulp.task('watch-ts', async () => {
3546

3647
gulp.task('default', (cb) => {
3748
const sequence = require('gulp-sequence');
38-
sequence('clean', 'compile-ts', cb);
49+
sequence('clean', 'compile-ts', 'compile-ts-umd', cb);
3950
});
4051

4152
gulp.task('dev', ['watch-ts']);

0 commit comments

Comments
 (0)