TypeScript + npm で.jsファイルを別ディレクトリにする

Angular 2 + TypeScript + npm で.jsファイルを別ディレクトリにする。

Visual Studio Codeでangular2のチュートリアルをやっていたら、
.tsファイルがあるディレクトリに.jsと.js.mapというファイルが生成されて、
Visual Studio CodeのファイルEXPLORERが見にくくなった。

tsconfig.json
"outDir": "dist"
を足す。

{
  "compilerOptions": {
    "target": "es5",
    "module": "system",
    "moduleResolution": "node",
    "sourceMap": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "removeComments": false,
    "noImplicitAny": false,
    "outDir": "dist"
  },
  "exclude": [
    "node_modules",
    "typings/main",
    "typings/main.d.ts"
  ]
}

distディレクトリが勝手にできて、.js .js.mapはそこに出力されるようになった。

http://blog.charto.net/node-js/Publishing-TypeScript-based-modules-on-npm/

勝手にdistディレクトリができたのは、 package.json

  "scripts": {
    "start": "concurrently \"npm run tsc:w\" \"npm run lite\" ",    
    "tsc": "tsc",
    "tsc:w": "tsc -w",

のように書いてあるからだと思う。
https://angular.io/docs/js/latest/styleguide.html