CSS loader for webpack that interprets @import and url() like import/require() and resolves them. Current stable version is 7.1.4 (Feb 2026), with frequent releases. Key differentiator: it is the official webpack CSS loader, supporting CSS Modules, source maps, and advanced options like importLoaders and camelCase. Requires webpack 4+ as a peer dependency. Versions 6.x had a breaking change in 6.7.0 (named export default changes), and version 7.0.0 makes modules.namedExport true by default when esModule is enabled, requiring a migration from default import to namespace import.
npm install css-loader-1Verified import paths — ran on the pinned version, not inferred.
Configures webpack to process CSS files with CSS Modules, loads them via style-loader, and uses the module's scoped class names.
Change `import styles from './style.css'` to `import * as styles from './style.css'` and update related code.
Use `import styles from './style.css'` and access styles.myClass, or configure `modules.exportLocalsConvention` to get the old behavior.
Use `modules.localIdentName` in the loader options.
Be consistent: either use only camelCase or only kebab-case imports to avoid confusion.
Remove `minimize` from css-loader options and use `CssMinimizerPlugin` in optimization.minimizer.
Run `npm install --save-dev style-loader`
Separate `composes` from `@import` in different files or avoid mixing them.
Run `npm install --save-dev webpack@^4` or install the appropriate version.
No dependency data recorded yet.