简体   繁体   English

打字稿编译器:套管问题

[英]Typescript transpiler: casing issue

I have a typescript file that used to be called Group.ts. 我有一个曾经被称为Group.ts的打字稿文件。 When transpiling to javascript the resulting file would be called Group.js. 当转换为javascript时,生成的文件将被称为Group.js。

I've now renamed the typescript file to group.ts (lowercase g). 我现在已将typescript文件重命名为group.ts(小写g)。 However, the resulting javascript file is still called Group.js (uppercase g). 但是,生成的javascript文件仍称为Group.js(大写g)。 Even after removing Group.js and Group.js.map files. 甚至在删除Group.js和Group.js.map文件之后。

I've tried renaming the typescript file to somegroup.ts and then the transpiled file was called somegroup.js (with correct casing). 我已经尝试将typescript文件重命名为somegroup.ts,然后将转换后的文件称为somegroup.js(正确的大小写)。 Then I renamed the file back to group.ts and the resulting javascript file is once again called Group.js (wrong casing). 然后我将文件重命名为group.ts,生成的javascript文件再次被称为Group.js(错误的大小写)。

Did anyone experience the same issue? 有没有人遇到过同样的问题? Btw, I'm working on a Mac in case that matters. 顺便说一句,我正在Mac上工作以防万一。

You have a /// <reference path="Group.ts" /> directive in some file (look closer to the 'root' of your compilation as the first name is the one that is used). 在某个文件中有一个/// <reference path="Group.ts" />指令(看起来更靠近编译的'根',因为第一个名称是使用的名称)。 The compiler, when faced with multiple spellings of the same name, has to arbitrarily pick one. 编译器在遇到多个同名拼写时,必须随意选择一个。

You can use the --forceConsistentCasingInFileNames commandline switch to more easily diagnose which file is in error. 您可以使用--forceConsistentCasingInFileNames命令行开关来更轻松地诊断哪个文件出错。

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

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