I have a project that is built using webpack and I use VS Code to edit it. Whenever I build the project from OUTSIDE of VS Code, the webpack build succeeds without any warnings. However, when I build from WITHIN VS code (e.g. either through a build command in tasks.json or from a PowerShell prompt from withing VS Code), I get many webpack warnings that look like this:
WARNING in (webpack)/buildin/module.js
There are multiple modules with names that only differ in casing.
This can lead to unexpected behavior when compiling on a filesystem with other case-semantic.
Use equal casing. Compare these module identifiers:
* D:\Users\<name>\Source\Repos\<name>\<name>\node_modules\source-map-loader\index.js!D:\Users\<name>\Source\Repos\<name>\<name>\node_modules\webpack\buildin\module.js
Used by 2 module(s), i. e.
....
* D:\Users\<name>\Source\Repos\<name>\<name>\node_modules\source-map-loader\index.js!d:\Users\<name>\Source\Repos\<name>\<name>\node_modules\webpack\buildin\module.js
Used by 1 module(s), i. e.
....
You might notice that the only way they differ is in the casing of the drive letter (D vs d). This is what I've gathered about the issue:
- When I start a cmd prompt, the d is lower-case and webpack does not complain.
- If I run from with VS code, webpack complains because VS Code intentionally upper-cases the drive letter in its ${workspaceRoot} variable and elsewhere. You can find many references to fixes and problems related to this behavior on this issue thread.
- There has been much discussion about how webpack also has had trouble with cases where the drive letter was differently cased. One example is here. There are other places that talk about it, and how NodeJs also has troubles like this.
The problem is that I don't know how to fix the situation. I don't seem to be able to change what VS Code does with its drive letters. I haven't found any recent issues on webpack about the issue (the link I posted above is from 2017). As far as I can tell, there's no way to tell webpack to suppress this particular warning (it doesn't even have a warning number associated with it).
What is the best way to address this issue now?
Thanks!
