tsconfigのlib
何を指定すればよいのか
dependenciesに追記すれば、その名前の標準libを上書きできる
例えば、以下のように書けば、標準のdomではなく、@types/webが読み込まれる
code:tsconfig.json
{
}
code:package.json
{
"dependencies": {
"@typescript/lib-dom": "npm:@types/web"
}
}
libのversion管理もこの方法でできる
以下の2通りのいずれかで指定する必要がある
と、ここに書いているが、公式には書いていないので本当なのかどうかわからん #?? 一つも指定しない
code:tsconfig.json
{
"compilerOptions": {
"target": "es2018"
// "lib": []
}
}
2つ以上指定する
code:tsconfig.json
{
"compilerOptions": {
"target": "es2018",
"lib": [
"es2018",
"esnext.AsyncIterable",
"esnext.Array",
"esnext.Intl",
"esnext.Symbol"
]
}
}
targetと同じものをlibでも指定する必要があるらしい