-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Casing of output js and js.map files is not consistent. #2011
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The compiler currently issues an error of a file name is uses with inconsistent cases only on case sensitive systems. see getSourceFileFromCache. A good change is to make this controlled by a flag, so that you get errors for inconsistent casing for file references, ensuring that the files are always generated in a consistent manner. |
I would consider this a bug. The compiler (in my opinion) should not be default change the file name casing. Even if I happened to name my file in a non standard way, the compiler should maintain the naming for the js file. |
@jkristia the problem is getting the actual file name from disk can be expensive, and most of the users do not care about it. this is why the compiler uses the first name of the file it encounters to identify it, be it on the command line, ///reference or import. I would assume that you have some inconsistent casing for file references in your project (either build script or /// reference); would me earlier suggestion of adding a flag to ensure you really reference all files consistently not work for you? |
This issue caused me a few hours of confusion as well. If the file system check is expensive, perhaps we could add a fallback to case-insensitive when the compiler has trouble finding the file? As an aid for people who have the same issue, the compiler error I was getting said, rather unhelpfully, "Module cannot be aliased to a non-module type." |
+1 million - One of our team members is having exactly the same problem and has been trying to fix this for the last hour with no luck. |
Is a filesystem check actually that expensive? This has been profiled? A few days ago I spent two hours chasing down package.config began with BOM - worked on my machine not on Azure. Two hours |
#5275 introduces a flag |
fixed in e811fec |
The fix should be in |
It seems my initial assessment was incorrect (see a bit below what I originally thought happened). It turns out the output filename of a typescript file is not cased the same as the typescript file, but the same as the casing in the reference path another typescript. So if I have one file name CamelCased.ts and one called pascalCased.ts. And I put a reference to camelCased.ts in that last one, this will compile but the output js file will be named camelCased.js and not CamelCased.js as I would have expected.
I don't know if I would call this a bug, but it sure is inconvenient.
[Original]
In a visual studio project containing multiple ts files some start with a capital, and some are all lower case. After the TypeScriptCompile action is called for a file using only lower case, all subsequent file outputs are lower cased, even for ts files that start with a capital.
Files that start with a capital who are compiled before the first lower cased file all have outputs that start with a capital letter.
I know I should be more consistent in my naming, but if you ask me, it's a rather subtle way of forcing me....
[/Original]
The text was updated successfully, but these errors were encountered: