{"id":19400,"library":"case-sensitive-paths-webpack-plugin","title":"Case-Sensitive Paths Webpack Plugin","description":"A Webpack plugin (current version 2.4.0) that enforces module path case sensitivity during builds, ensuring that the entire path of all required modules matches the exact case on disk. This helps prevent subtle bugs on case-insensitive filesystems (macOS, Windows) from causing failures on case-sensitive systems (Linux). Works with Webpack 3, 4, and 5. Releases are infrequent but stable, with minimal dependencies.","status":"active","version":"2.4.0","language":"javascript","source_language":"en","source_url":"https://github.com/Urthen/case-sensitive-paths-webpack-plugin","tags":["javascript","webpack","plugin","case sensitive","import","require"],"install":[{"cmd":"npm install case-sensitive-paths-webpack-plugin","lang":"bash","label":"npm"},{"cmd":"yarn add case-sensitive-paths-webpack-plugin","lang":"bash","label":"yarn"},{"cmd":"pnpm add case-sensitive-paths-webpack-plugin","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Package is CommonJS-only; no default ESM export. Use require() or use createRequire in ESM.","wrong":"import CaseSensitivePathsPlugin from 'case-sensitive-paths-webpack-plugin';","symbol":"CaseSensitivePathsPlugin","correct":"const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin');"},{"note":"Pass an object with optional `debug` property (default false). Omitting options is fine.","wrong":"new CaseSensitivePathsPlugin({debug: false})","symbol":"Plugin options","correct":"new CaseSensitivePathsPlugin({ debug: true })"},{"note":"Must instantiate the plugin: `new CaseSensitivePathsPlugin()`, not reference the class.","wrong":"module.exports.plugins = [CaseSensitivePathsPlugin]","symbol":"Webpack plugin registration","correct":"plugins: [new CaseSensitivePathsPlugin()]"}],"quickstart":{"code":"// webpack.config.js\nconst CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin');\n\nmodule.exports = {\n  // ... other webpack config\n  plugins: [\n    new CaseSensitivePathsPlugin({\n      debug: false // set to true for verbose logging\n    })\n  ]\n};","lang":"javascript","description":"Adds case-sensitive path enforcement to a Webpack configuration, catching mismatches during builds."},"warnings":[{"fix":"Use `debug: false` to minimize overhead; consider disabling for production builds if not needed.","message":"The plugin may cause slowdowns on large projects because it performs filesystem reads for each resolved module path.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use only in Webpack config. For other bundlers, find alternative or write a custom plugin.","message":"Works only with Webpack (not Vite, Rollup, etc.). Misleading if porting to other bundlers.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Correct the casing of the import path to match the actual filesystem case.","cause":"Import statement uses incorrect casing for the module path.","error":"Module not found: Error: [CaseSensitivePathsPlugin] `/path/to/file.js` does not match the corresponding path on disk `/path/to/File.js`"},{"fix":"Run `npm install --save-dev case-sensitive-paths-webpack-plugin`.","cause":"Package not installed or not in devDependencies.","error":"Cannot find module 'case-sensitive-paths-webpack-plugin'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}