Urthen / case-sensitive-paths-webpack-plugin

Enforces case sensitive paths in Webpack requires.
MIT License
428 stars 45 forks source link

Any way to exclude node_modules? #24

Closed petrgazarov closed 6 years ago

petrgazarov commented 6 years ago

Hi there! Thanks for the library.

I'm getting an error from a third-party package that I installed in node_modules.

ERROR in ./node_modules/react-codemirror/lib/Codemirror.js
Module not found: Error: [CaseSensitivePathsPlugin] `/Users/petrgazarov/workspace/clause/packages/clause-hub/node_modules/react-codemirror/src/codemirror.js` does not match the corresponding path on disk `Codemirror.js`.
 @ ./node_modules/react-codemirror/lib/Codemirror.js 38:42-63
 @ ./src/components/TemplateForm/Form.js
 @ ./src/components/TemplateForm/index.js
 @ ./src/containers/Dashboard/index.js
 @ ./src/routes/index.js
 @ ./src/main.js
 @ multi (webpack)-dev-server/client?http://localhost:8888 ./src/main.js
Urthen commented 6 years ago

Hey @petrgazarov - There's not any possibility for exclusions right now, by design. Any exclusion, even for third-party code, effectively could mean that your whole build could fail on case-sensitive systems and therefore bypass the whole point of this plugin.

It looks like there is a fork of react-codemirror available which resolves this particular issue, which might help you move forward.

If you need to use react-codemirror for some reason, unfortunately the best I can offer you is to disable this plugin until react-codemirror merges the PR to fix the case-sensitivity issue, though it's been open since July so not sure when/if it'll ever be looked at.

petrgazarov commented 6 years ago

Hey @Urthen, thanks for your answer! It makes perfect sense why you don't want to be able to "exclude" directories. react-codemirror2 project indeed solves the casing problem. 👍