我有一个来自以下两个 tsconfig.json
文件的问题,它们位于同一个项目中,一个扩展了另一个:
父级
{
"compilerOptions": {
"experimentalDecorators": true,
"skipLibCheck": true,
"module": "ESNext"
}
// ...
子级
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "./out-tsc/app",
"module": "esNext",
},
// ...
}
不清楚:
- 模块参数区分大小写吗?
- 像这样的设置,子配置扩展了父配置,模块类型相同,但大小写不同。这会以某种方式影响输出,给出不同的结果吗? (我想说,如果模块相等,则应该仅在父级中定义)。
可用信息
来自another answer :
In order to make code portable, it's important to make sure the casing in a module specifier matches the referenced file name exactly.
当我说“使代码可移植”时,我不确定OP指的是什么,对此有任何澄清吗?
谢谢
最佳答案
它似乎不区分大小写,因为我尝试了“esnext”和“ESnext”并得到了相同的输出。
关于 typescript 配置: is module setting case sensitive?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62943333/