Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

case-sensitive-paths-webpack-plugin

Urthen24.1mMIT2.4.0TypeScript support: definitely-typed

Enforces module path case sensitivity in Webpack

webpack, plugin, case sensitive, import, require

readme

Case Sensitive Paths - Webpack Plugin

Build Status Known Vulnerabilities npm version npm downloads bananas: ripe FOSSA Status

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 iterations 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

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:

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

License

FOSSA Status

changelog

Changelog

All notable changes to this project will be documented in this file. Dates are displayed in UTC.

Generated by auto-changelog.

v2.4.0

  • Updating versions & tests for development 1d11967
  • Update dependencies, travis targets. 31491e0
  • Run prettier on test index. 3bf9fa2
  • Run prettier across index. f12aa57
  • Automatically generate changelog dc7765e
  • Add test case ensuring deeply nested folder case problems are caught 198c7e1
  • [#54] Unescape # in paths 7d05a0a
  • Change the pathCache to be a Map. 737dadd
  • Changelog c662bc4
  • Bump lodash from 4.17.15 to 4.17.19 08dec5d
  • Credit 30dcfc1

v2.3.0

15 January 2020

  • Testing updates #37
  • Use the before emit hook to check if files exist #36
  • Add configurable logger #38
  • Linting and dependency updates. d4fc994
  • Update for Node 4 use to prevent major semver bump e400f17
  • Start using AutoChangelog c2b6ca1
  • Update tests to properly account for Webpack 5 changes d84f848
  • Remove Node 4 from Travis test as it is flaky. 329d32d
  • Add Travis support for Webpack 5 and Node 12. 4e9b361
  • Update index.js bef726c
  • Fix for #40 1c8e615

v2.1.2

6 March 2018

  • Add support for webpack 4 #31
  • Add license scan report and status #27
  • Merge FOSSA's badge be74649
  • Release 2.1.0 - No longer return our own error on file not found. fb1d636
  • Testing improvements. 2abbfce
  • Release 2.1.1 - Properly support older versions of node aaef33f
  • Add badges. d1563c7
  • Fix test. 6f2519b
  • Fix badges. face6dc
  • Update README.md 5cfb570

v2.0.0

31 March 2017

  • Use compiler filesystem #14
  • Add files to package.json. #15
  • Update README.md #13

1.1.4

6 September 2016

  • Don't crash on folder deletion with tests #10
  • Normalize filenames to default Unicode Normalization Form (NFC) so th… #6
  • Working E2E Tests in a Demo Project #4
  • check for windows-style root paths #2
  • Create a working React/Webpack project, with Jasmine unit tests that demonstrate the functionality of the plugin. de4c1e5
  • Initial Code bb1d65b
  • Drastically reduce filesystem operations required, release v1.1.0 ca03460
  • Added failing test when a folder is deleted while watching files e35eada
  • Initial commit e47ac63
  • Added a basic test 293d43a
  • More verbose output, add readme. 961e350
  • Handle situations where user has CDed into incorrectly cased directory d02babf
  • 1.1.1 - Fix bug related to the cache and hot-reloading d287045
  • Use @gaearon's method to stop crashes 83ac4db
  • Catch errors in plugin and propagate them e4fbf33
  • Credit where credit is due 8124d95
  • update main README; 52fc97c
  • Update README.md 33db517
  • Normalize filenames to default Unicode Normalization Form (NFC) so that all utf8-characters are compared correctly. 41d9418
  • kill the recursive reference loop by directly accessing the package's main 9f980f6
  • Readme updates, bump version 4be829d
  • I know how markdown works, I swear 5daec2c
  • Release 1.1.3 21390e1
  • readability edit 99c0f0d
  • Reduce waittime d0fd084
  • Credit 8818e92
  • remove the unnecessary require 45bb0bb