# case-sensitive-paths-webpack-plugin

> Enforces module path case sensitivity in Webpack

Latest version **2.4.0** (published 2021-02-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install case-sensitive-paths-webpack-plugin
pnpm add case-sensitive-paths-webpack-plugin
yarn add case-sensitive-paths-webpack-plugin
bun add case-sensitive-paths-webpack-plugin
```

## Health

**Score 23/100 (F)** — status: abandoned.

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.4.0 |
| Published | 2021-02-22 |
| First published | 2016-03-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/case-sensitive-paths-webpack-plugin) |
| Module format | CommonJS |
| Node | >=4 |
| Dependencies | 0 |
| Unpacked size | 25.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 427 |
| Author | Michael Pratt |
| Maintainers | urthen |
| Keywords | webpack, plugin, case sensitive, import, require |

## Links

- npm: https://www.npmjs.com/package/case-sensitive-paths-webpack-plugin
- Repository: https://github.com/Urthen/case-sensitive-paths-webpack-plugin
- Homepage: https://github.com/Urthen/case-sensitive-paths-webpack-plugin#readme
- Issues: https://github.com/Urthen/case-sensitive-paths-webpack-plugin/issues
- npm.io page: https://npm.io/package/case-sensitive-paths-webpack-plugin

## Alternatives

- [@mce/gif](https://npm.io/package/@mce/gif.md) — 2.6K weekly downloads
- [cleanse](https://npm.io/package/cleanse.md) — 173 weekly downloads
- [str](https://npm.io/package/str.md) — 127 weekly downloads
- [naming](https://npm.io/package/naming.md) — 95 weekly downloads
- [tap-telco-api](https://npm.io/package/tap-telco-api.md) — 19 weekly downloads

## Recent versions

- 2.4.0 (latest) — 2021-02-22
- 2.3.0 — 2020-01-15
- 2.2.0 — 2019-01-24
- 2.1.2 — 2018-03-06
- 2.1.1 — 2017-05-30
- 2.1.0 — 2017-05-30
- 2.0.0 — 2017-03-31
- 1.1.4 — 2016-09-06
- 1.1.3 — 2016-08-08
- 1.1.2 — 2016-07-08
- 1.1.1 — 2016-06-20
- 1.1.0 — 2016-05-27
- 1.0.1 — 2016-03-10
- 1.0.0 — 2016-03-04

## README

Case Sensitive Paths - Webpack Plugin
==========

[![Build Status](https://travis-ci.org/Urthen/case-sensitive-paths-webpack-plugin.svg?branch=master)](https://travis-ci.org/Urthen/case-sensitive-paths-webpack-plugin)
[![Known Vulnerabilities](https://snyk.io/test/github/urthen/case-sensitive-paths-webpack-plugin/badge.svg?targetFile=package.json)](https://snyk.io/test/github/urthen/case-sensitive-paths-webpack-plugin?targetFile=package.json)
[![npm version](https://badge.fury.io/js/case-sensitive-paths-webpack-plugin.svg)](https://badge.fury.io/js/case-sensitive-paths-webpack-plugin)
[![npm downloads](https://img.shields.io/npm/dw/case-sensitive-paths-webpack-plugin.svg)](https://www.npmjs.com/package/case-sensitive-paths-webpack-plugin)
![bananas: ripe](https://img.shields.io/badge/bananas-ripe-yellow.svg)
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FUrthen%2Fcase-sensitive-paths-webpack-plugin.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2FUrthen%2Fcase-sensitive-paths-webpack-plugin?ref=badge_shield)

This Webpack plugin enforces the entire path of all required modules match the exact case of the actual path on disk.
Using this plugin helps alleviate cases where developers working on OSX, which does not follow strict path case sensitivity,
will cause conflicts with other developers or build boxes running other operating systems which require correctly cased paths.

[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
the entire path. This plugin fixes that. Example output:

> ERROR in ./src/containers/SearchProducts.js
  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`
   @ ./src/containers/SearchProducts.js 9:22-84

Install
----
    npm install --save-dev case-sensitive-paths-webpack-plugin

Usage
----

```JavaScript
var CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin');

var webpackConfig = {
    plugins: [
        new CaseSensitivePathsPlugin()
        // other plugins ...
    ]
    // other webpack config ...
}
```

Want more information? Pass ```{debug: true}``` to the plugin like so:

```JavaScript
new CaseSensitivePathsPlugin({debug: true})
```

It will output every directory it reads, as well as a sum total of filesystem operations.
This is mostly useful for internal debugging of the plugin, but if you find it useful, more power to you.

Demo
---
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.

Thanks & Credit
----
* [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
* [Alexandre Kirszenberg](https://github.com/Morhaus) who's [gist](https://gist.github.com/Morhaus/333579c2a5b4db644bd5) formed the basis of both these plugins.
* [Cameron Brewer](https://github.com/morethanfire) and [Ben Collins](https://github.com/aggieben) who added Windows support.
* [Christian Lilley](https://github.com/xml) who added a demo/test package.
* [Lance Eastgate](https://github.com/NorwegianKiwi) who added some internationalization support
* [Jonathan Kim](https://github.com/jkimbo) and [Dan Abramov](https://github.com/gaearon) who investigated, fixed, and added some tests for a crashing bug.
* [Jason Quense](https://github.com/jquense) who switched it to properly use the webpack-provided fs object.
* [Cesare Soldini](https://github.com/caesarsol) who added a test
* [Kirill Konshin](https://github.com/kirill-konshin) who helped update to Webpack 5


## License
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FUrthen%2Fcase-sensitive-paths-webpack-plugin.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2FUrthen%2Fcase-sensitive-paths-webpack-plugin?ref=badge_large)

---
_Source: https://npm.io/package/case-sensitive-paths-webpack-plugin · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
