| 1 | Case Sensitive Paths - Webpack Plugin
|
|---|
| 2 | ==========
|
|---|
| 3 |
|
|---|
| 4 | [](https://travis-ci.org/Urthen/case-sensitive-paths-webpack-plugin)
|
|---|
| 5 | [](https://snyk.io/test/github/urthen/case-sensitive-paths-webpack-plugin?targetFile=package.json)
|
|---|
| 6 | [](https://badge.fury.io/js/case-sensitive-paths-webpack-plugin)
|
|---|
| 7 | [](https://www.npmjs.com/package/case-sensitive-paths-webpack-plugin)
|
|---|
| 8 | 
|
|---|
| 9 | [](https://app.fossa.io/projects/git%2Bgithub.com%2FUrthen%2Fcase-sensitive-paths-webpack-plugin?ref=badge_shield)
|
|---|
| 10 |
|
|---|
| 11 | This Webpack plugin enforces the entire path of all required modules match the exact case of the actual path on disk.
|
|---|
| 12 | Using this plugin helps alleviate cases where developers working on OSX, which does not follow strict path case sensitivity,
|
|---|
| 13 | will cause conflicts with other developers or build boxes running other operating systems which require correctly cased paths.
|
|---|
| 14 |
|
|---|
| 15 | [Previous](https://gist.github.com/Morhaus/333579c2a5b4db644bd50) [iterations](https://github.com/dcousineau/force-case-sensitivity-webpack-plugin) on this same idea provide the basis for this plugin, but unfortunately do not properly check case on
|
|---|
| 16 | the entire path. This plugin fixes that. Example output:
|
|---|
| 17 |
|
|---|
| 18 | > ERROR in ./src/containers/SearchProducts.js
|
|---|
| 19 | Module not found: Error: [CaseSensitivePathsPlugin] `/Users/example/yourproject/src/components/searchProducts/searchproducts.js` does not match the corresponding path on disk `/Users/example/yourproject/src/components/searchproducts`
|
|---|
| 20 | @ ./src/containers/SearchProducts.js 9:22-84
|
|---|
| 21 |
|
|---|
| 22 | Install
|
|---|
| 23 | ----
|
|---|
| 24 | npm install --save-dev case-sensitive-paths-webpack-plugin
|
|---|
| 25 |
|
|---|
| 26 | Usage
|
|---|
| 27 | ----
|
|---|
| 28 |
|
|---|
| 29 | ```JavaScript
|
|---|
| 30 | var CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin');
|
|---|
| 31 |
|
|---|
| 32 | var webpackConfig = {
|
|---|
| 33 | plugins: [
|
|---|
| 34 | new CaseSensitivePathsPlugin()
|
|---|
| 35 | // other plugins ...
|
|---|
| 36 | ]
|
|---|
| 37 | // other webpack config ...
|
|---|
| 38 | }
|
|---|
| 39 | ```
|
|---|
| 40 |
|
|---|
| 41 | Want more information? Pass ```{debug: true}``` to the plugin like so:
|
|---|
| 42 |
|
|---|
| 43 | ```JavaScript
|
|---|
| 44 | new CaseSensitivePathsPlugin({debug: true})
|
|---|
| 45 | ```
|
|---|
| 46 |
|
|---|
| 47 | It will output every directory it reads, as well as a sum total of filesystem operations.
|
|---|
| 48 | This is mostly useful for internal debugging of the plugin, but if you find it useful, more power to you.
|
|---|
| 49 |
|
|---|
| 50 | Demo
|
|---|
| 51 | ---
|
|---|
| 52 | Check the `/demo` directory for a working example of the plugin in action, with tests demonstrating the effect of the plugin. See `/demo/README.md` for more.
|
|---|
| 53 |
|
|---|
| 54 | Thanks & Credit
|
|---|
| 55 | ----
|
|---|
| 56 | * [Daniel Cousineau](https://github.com/dcousineau) who wrote an [earlier version](https://github.com/dcousineau/force-case-sensitivity-webpack-plugin) of this case-sensitivity plugin
|
|---|
| 57 | * [Alexandre Kirszenberg](https://github.com/Morhaus) who's [gist](https://gist.github.com/Morhaus/333579c2a5b4db644bd5) formed the basis of both these plugins.
|
|---|
| 58 | * [Cameron Brewer](https://github.com/morethanfire) and [Ben Collins](https://github.com/aggieben) who added Windows support.
|
|---|
| 59 | * [Christian Lilley](https://github.com/xml) who added a demo/test package.
|
|---|
| 60 | * [Lance Eastgate](https://github.com/NorwegianKiwi) who added some internationalization support
|
|---|
| 61 | * [Jonathan Kim](https://github.com/jkimbo) and [Dan Abramov](https://github.com/gaearon) who investigated, fixed, and added some tests for a crashing bug.
|
|---|
| 62 | * [Jason Quense](https://github.com/jquense) who switched it to properly use the webpack-provided fs object.
|
|---|
| 63 | * [Cesare Soldini](https://github.com/caesarsol) who added a test
|
|---|
| 64 | * [Kirill Konshin](https://github.com/kirill-konshin) who helped update to Webpack 5
|
|---|
| 65 |
|
|---|
| 66 |
|
|---|
| 67 | ## License
|
|---|
| 68 | [](https://app.fossa.io/projects/git%2Bgithub.com%2FUrthen%2Fcase-sensitive-paths-webpack-plugin?ref=badge_large)
|
|---|