10
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

TypeScript3 tsconfig.jsonで出力先ディレクトリを設定する。

Last updated at Posted at 2018-09-15

環境

PS C:\> tsc -v
Version 3.0.1

結果

rootDiroutDirを設定する。

./tsconfig.json
{
    "compilerOptions": {
        "target": "es2018",
        "module": "commonjs",
        "sourceMap": true,
        "rootDir": ".",
        "outDir": "../build/"
    }
}

tscコマンド実行でoutDirに指定したディレクトリbuildが生成され、その中にコンパイルされる。ディレクトリ構成も維持される。

C:
│
├─build
│  │  index.js
│  │  index.js.map
│  │
│  └─library
│          libSample1.js
│          libSample1.js.map
│          libSample2.js
│          libSample2.js.map
|
└─src
    │  .gitignore
    │  index.ts
    │  tsconfig.json
    │
    └─library
            libSample1.ts
            libSample2.ts
10
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?