Skip to content

Commit

Permalink
fix: 产出编译包入口&类型
Browse files Browse the repository at this point in the history
  • Loading branch information
chaiyanchen committed Sep 14, 2020
1 parent afca02e commit 4c4ef05
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 5 additions & 2 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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', () => {
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 4c4ef05

Please sign in to comment.