2016-11-22 73 views
1

自從我升級到Typescript 2.0以來,tsc編譯器不會爲我的代碼生成定義文件。這裏是我的tsconfig.json在Typescript 2.0中不生成類型聲明

{ 
    "compilerOptions": { 
    "target": "es5", 
    "noImplicitAny": false, 
    "removeComments": true, 
    "sourceMap": true, 
    "module": "commonjs", 
    "experimentalDecorators": true, 
    "declaration": true, 
    "declarationDir": "./dist", 
    "lib": ["es2015", "dom"], 
    "types": [ 
     "node" 
    ] 
    }, 
    "include": [ 
    "src/**/*.ts", 
    "node_modules/@types/**/*.d.ts" 
    ], 
    "exclude": [ 
    "src/**/*-spec.ts", 
    "index.d.ts", 
    "dist/", 
    "build/", 
    "node_modules/shn-dropdown/**/*.d.ts", 
    "node_modules/**/build/" 
    ], 
    "version": "2.0." 
} 

有了TS 1.8.9,我.d.ts文件生成到dist/src/和鏡像我src/目錄的文件結構。據我可以告訴我的配置文件是正確的每specCLI documentation

回答

0

我仍然不知道是什麼造成了這個問題。但升級到TS 2.1.0後不再發生。

相關問題