2016-03-20 11 views
1

私はmgechevによってAngular2の種を使用し始めました。私はTypescriptのトランスバータに関して簡単な質問をしました。angular2の種子Typescript transpileの設定(出力)

現在、 'src'フォルダ内のすべてが '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 
} 
+0

[この](http://stackoverflow.com/questions/29908200/を見てみましょうtsconfig-how-to-set-correct-compiler-output-multiple-for-multiple-directory)の質問を使用して、コンパイル済みファイルの出力ディレクトリを変更します。 –

答えて

2

あなたはdistの値を使用してtsconfig.jsonファイルにOUTDIRプロパティを使用することができます

{ 
    "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 
} 
関連する問題