LoginSignup
1
0

More than 3 years have passed since last update.

TypeScriptのチュートリアル見てて少しハマった話(jsファイル出力先(outDir)が指定しても出力されない)

Last updated at Posted at 2021-02-15

TypeScriptチュートリアル見てて少しハマった話

を試してて、
tsconfig.jsonに
jsファイルの出力ディレクトリを指定できるよって書いてあるんだけど
指定しても、そこに出力されず15分悩んだなので共有。

tsconfig.json
{
  "compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "outDir": "out"
  }
}

このあとに、
tsc をオプション指定なしで実行せよ

Delete helloworld.js and run the command tsc with no options.

って書いてあるのを見落として、オプション指定つけて

tsc helloworld.ts

をずっとやっててハマりました。

tsc

で実行しないと、
tsconfig.jsonのオプションを読み込んでトランスパイルしてくれません。

1
0
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
1
0