What is the recommended config for typescript if I want to ue the compiled sources with node 8?
most tutorials use the following tsconig.json:
{
"compilerOptions": {
"target": "es6",
"module": "commonjs"
}
}
But now I figured out, that not all available features are supported. For example ['foo'].includes('bar')
throws the error: Property 'includes' does not exist on type 'string[]'.
I found an issue that addresses this problem. The solution is to use the lib es7
.
I could overwrite the default libs: "lib": ["es7"]
But I'm not sure if this is the best config for node 8 - are there more features which are not supported by that lib? are there to much features defined?
So my question is: What are the best configurations for target
, lib
and module
if I want to use node 8?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…