What changed in css-loader from 6 to 7
7 releases numbered after v6.11.0 up to and including v7.1.5, stable releases only. v6.11.0 and v7.1.5 are the newest stable releases of 6 and 7 we track; this page follows them as new ones ship.
- 1 mentions breaking changes
14 changes across 7 releases
Added 3
Changed 4
- The modules.namedExport option is true by default if you enable the esModule option
- The modules.exportLocalsConvention has the value as-is when the modules.namedExport option is true and you don't specify a value
- Minimum supported webpack version is 5.27.0
- Minimum supported Node.js version is 18.12.0
Fixed 7
- strip BOM before processing with postcss
- update peer dependency for @rspack/core v2
- Allow to use `module` class name
- Use official `createHash` for hashes
- Use official `hash*` options for hashes
- keep order of @import statements with the webpackIgnore comment
- automatically rename class `default` to `_default` when named export is enabled
Original release notes, newest first
The list above is our reading of these notes; the originals from css-loader are here, one fold per release.
v7.1.5
v7.1.4
v7.1.3
v7.1.2
7.1.2 (2024-05-22)
Bug Fixes
v7.1.1
7.1.1 (2024-04-10)
Bug Fixes
v7.1.0
7.1.0 (2024-04-08)
Features
v7.0.0
7.0.0 (2024-04-04)
⚠ BREAKING CHANGES
- The
modules.namedExportoption istrueby default if you enable theesModuleoption
Migration guide:
Before:
import style from "./style.css";
console.log(style.myClass);
After:
import * as style from "./style.css";
console.log(style.myClass);
Typescript migration:
Before:
declare module '*.module.css' {
const classes: { [key: string]: string };
export default classes;
}
After:
declare module '*.module.css' {
const classes: { [key: string]: string };
export = classes;
}
- The
modules.exportLocalsConventionhas the valueas-iswhen themodules.namedExportoption istrueand you don't specify a value - Minimum supported webpack version is
5.27.0 - Minimum supported Node.js version is
18.12.0