简体   繁体   English

Typescript 配置:模块设置是否区分大小写?

[英]Typescript configuration: is module setting case sensitive?

I've got a question coming from the following two tsconfig.json files, they're in the same project, one extends the other:我有一个来自以下两个tsconfig.json文件的问题,它们在同一个项目中,一个扩展另一个:

Parent家长

{
  "compilerOptions": {
    "experimentalDecorators": true,
    "skipLibCheck": true,
    "module": "ESNext"
    }
    // ...

Child孩子

{
  "extends": "./tsconfig.json",
  "compilerOptions": {
    "outDir": "./out-tsc/app",
    "module": "esNext",
   },
   
   // ...

}

It's unclear:目前还不清楚:

  1. is the module param case sensitive?模块参数是否区分大小写?
  2. a setup like this, with a child config extending the parent, same module type, but with different case.像这样的设置,具有扩展父级的子配置,相同的模块类型,但大小写不同。 Would that affect the ouput somehow, giving different results?这会以某种方式影响输出,给出不同的结果吗? (I'd say that if the module is equal, it should be defined only in the parent). (我会说如果模块是相等的,它应该只在父级中定义)。

Info available可用信息

From 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.为了使代码可移植,确保模块说明符中的大小写与引用的文件名完全匹配很重要。

I'm not sure what does the OP refers to, when saying "to make code portable", any clarification about it?我不确定 OP 指的是什么,当说“使代码可移植”时,有什么澄清吗?

Thanks谢谢

It seems to be case-insensitive as I tried "esnext" and "ESnext" and got the same output.当我尝试“esnext”和“ESnext”并得到相同的 output 时,它似乎不区分大小写。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM