Skip to content

Commit

Permalink
Merge pull request #4 from DG-Wangtao/feat/ts
Browse files Browse the repository at this point in the history
fix: 解决使用TypeScript时,生产模式下加载`.ts`文件时报错
  • Loading branch information
DG-Wangtao authored Apr 8, 2019
2 parents 6b07781 + e94dee5 commit a89bcb6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
11 changes: 0 additions & 11 deletions .drone.yml

This file was deleted.

8 changes: 8 additions & 0 deletions lib/document/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,14 @@ function getTag_Path(fileDir, securitys, swagger, definitions) {

if (stat.isFile() && ['.js', '.ts'].indexOf(path.extname(name)) !== -1) {

const extname = path.extname(name);
if (extname === '.ts') {
const jsFile = name.replace('.ts', '.js');
if (names.indexOf(jsFile) >= 0) {
continue;
}
}

let blocks = comment.generateCommentBlocks(filepath);

// 如果第一个注释块不包含@controller不对该文件注释解析
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "egg-swagger-doc-feat",
"version": "2.2.11",
"version": "2.2.12",
"description": "swagger for egg",
"eggPlugin": {
"name": "swaggerdoc"
Expand Down Expand Up @@ -55,4 +55,4 @@
"homepage": "https://github.com/DG-Wangtao/egg-swagger-doc#readme",
"author": "yanshijie, wayland, jasine",
"license": "MIT"
}
}

0 comments on commit a89bcb6

Please sign in to comment.