From 4c4ef05238deaaa15bbe1097658124662952396a Mon Sep 17 00:00:00 2001 From: chaiyanchen Date: Mon, 14 Sep 2020 20:51:03 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BA=A7=E5=87=BA=E7=BC=96=E8=AF=91?= =?UTF-8?q?=E5=8C=85=E5=85=A5=E5=8F=A3&=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gulpfile.js | 7 +++++-- package.json | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 0259e59..fc8b992 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -19,7 +19,7 @@ const filter = require('gulp-filter'); gulp.task('build', () => { const f = filter(['**/*.js'], { restore: true }); - return gulp + const stream = gulp .src(['src/**/*.ts'], { base: path.resolve('src') }) .pipe(project()) .pipe(f) @@ -28,8 +28,11 @@ gulp.task('build', () => { anonymousModule: ['**/*'], exlude: ['*.ts'] })) - .pipe(f.restore) .pipe(gulp.dest('dist')); + + f.restore.pipe(gulp.dest('dist/types')); + + return stream; }); gulp.task('build-demo', () => { diff --git a/package.json b/package.json index 7b8638a..5234fc0 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,8 @@ "name": "@searchfe/inject-js", "version": "0.0.0-development", "description": "A Dependency Injection library", - "main": "index.js", + "main": "dist/index.js", + "types": "dist/types/index.d.ts", "scripts": { "test": "jest", "demo": "ts-node demo",