以下の通りにキーバインドされている。
{ "key": "shift+cmd+v",
"command": "markdown.showPreview",
bash-3.2$ tree -a
.
|-- .vscode
| |-- launch.json
| `-- tasks.json
|-- README.md
|-- dest
| |-- test.js
| `-- test.js.map
|-- index.html
|-- src
| `-- test.ts
`-- tsconfig.json
- tasks.json
- launch.json
tsc(typescriptのトランスパイラ)に喰わせるオプションファイル
表示>統合ターミナルでbashを開き、そこからtsc --init
でpwdにtsconfig.jsonを吐く
--init
Initializes a TypeScript project and creates a tsconfig.jso
n file.
デフォルトの値
{
"compilerOptions": {
"module": "commonjs",
"target": "es5",
"noImplicitAny": false,
"sourceMap": false
}
}
個人的に設定した例
{
"compilerOptions": {
"target": "ES6",
"module": "commonjs",
"sourceMap": true,
"outDir": "dest"
},
"include": [
"src/*"
]
}
http://www.typescriptlang.org/docs/handbook/compiler-options.html に書いてある。
前掲のcompiler-options.htmlより引用。 大文字の場合、下記のデフォルトライブラリがinjectされる。 試してみたところ小文字でも同じっぽい。
Note: If --lib is not specified a default library is injected. The default library injected is:
► For --target ES5: DOM,ES5,ScriptHost
► For --target ES6: DOM,ES6,DOM.Iterable,ScriptHost
.vscode
の中ではなく、(プロジェクト)フォルダの直下。
ここじゃなくても良いのかもしれないが、
tscが読み込める場所であれば良いのだろう。
tasks.json
のなかで "args": ["-p","."]
の設定をしていないと、tscがtsconfig.jsonを認識してくれない模様。
-p DIRECTORY, --project DIRECTORY
Compile the project in the given directory.
デバッガでデバッグするときの構成ファイル。
chromeを完全に終了させてから、デバッガを実行。 すると、chromeが勝手に起動してVS Codeからデバッグが可能となる。 デバッガが正しく動くと舌のステータスバーが茶色(オレンジ?)になる。
tsconfig.jsonについてはここを見ると良い・ここさえ見ておけば大丈夫