angular2 seed Typescript transile设置(输出)

时间:2016-03-20 05:49:17

标签: typescript angular angular-seed transpiler

我已经开始使用mgechev的Angular2 Seed,而且我有一个关于Typescript转换器的简单问题。

目前' src'文件夹将被转换为' dist' dist夹。但与此同时,所有.ts文件也会在自己的文件夹中转换为.js和.js.map,这会使整个文件夹变得有点乱。

我的问题:如何禁用此行为?我希望.ts文件只被转换成dist文件夹一次。低于我在tsconfig.json中的当前设置

非常感谢干杯!

{
  "compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "declaration": false,
    "removeComments": true,
    "noLib": false,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "sourceMap": true,
    "pretty": true,
    "allowUnreachableCode": false,
    "allowUnusedLabels": false,
    "noImplicitAny": true,
    "noImplicitReturns": true,
    "noImplicitUseStrict": false,
    "noFallthroughCasesInSwitch": true
  },
  "exclude": [
    "node_modules",
    "typings/browser.d.ts",
    "typings/browser/**"
  ],
  "compileOnSave": false
}

1 个答案:

答案 0 :(得分:2)

您可以使用dist值将outDir属性用于tsconfig.json文件:

{
  "compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "declaration": false,
    "removeComments": true,
    "noLib": false,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "sourceMap": true,
    "pretty": true,
    "allowUnreachableCode": false,
    "allowUnusedLabels": false,
    "noImplicitAny": true,
    "noImplicitReturns": true,
    "noImplicitUseStrict": false,
    "noFallthroughCasesInSwitch": true,
    "outDir": "dist" // <-------
  },
  "exclude": [
    "node_modules",
    "typings/browser.d.ts",
    "typings/browser/**"
  ],
  "compileOnSave": false
}