# What changed in postcss-modules

> 13 changes in postcss-modules 7 to 9 from its official release notes, upgrade guides and advisories: 2 breaking, 7 new APIs and options. Each one cited. Sources checked 2026-10-19. HTML: https://unstale.sh/npm/postcss-modules/

To see which of these apply to a repository, run `npx @unstale/cli init` in it.

## postcss-modules 9

### Breaking changes

- The minimum Node.js version is now 20.6, the release that stabilized module.register. (9.0.0) — [release notes](https://github.com/css-modules/postcss-modules/blob/651a6b11d7185ba9e2065bf26aa09a0269f0cacf/CHANGELOG.md#900)

### New APIs and options

- Run Node with the loader imported to enable CSS imports that return the class-name token map. (9.0.0) — [release notes](https://github.com/css-modules/postcss-modules/blob/651a6b11d7185ba9e2065bf26aa09a0269f0cacf/CHANGELOG.md#900)
- Loader options can also be supplied under a postcss-modules key in package.json, using the same shape as the PostCSS plugin. (9.0.0) — [release notes](https://github.com/css-modules/postcss-modules/blob/651a6b11d7185ba9e2065bf26aa09a0269f0cacf/CHANGELOG.md#900)
- The environment variable is an additional location for loader options. (9.0.0) — [release notes](https://github.com/css-modules/postcss-modules/blob/651a6b11d7185ba9e2065bf26aa09a0269f0cacf/CHANGELOG.md#900)
- Adds an opt-in Node module-customization hook that lets JavaScript import CSS and receive its class-name token map as the default export. (9.0.0) — [release notes](https://github.com/css-modules/postcss-modules/blob/651a6b11d7185ba9e2065bf26aa09a0269f0cacf/CHANGELOG.md#900)
- Loader options can be configured in this file in the current working directory, using the same shape as the PostCSS plugin. (9.0.0) — [release notes](https://github.com/css-modules/postcss-modules/blob/651a6b11d7185ba9e2065bf26aa09a0269f0cacf/CHANGELOG.md#900)

### Fixes and other changes

- Added a type declaration so TypeScript users can extend the loader with declare module without hitting a type error. (9.0.1) — [release notes](https://github.com/css-modules/postcss-modules/blob/651a6b11d7185ba9e2065bf26aa09a0269f0cacf/CHANGELOG.md#901)

## postcss-modules 8

### New APIs and options

- The new 'all' value emits the original class name plus camelCase and dashes-camelCase variants in one pass. (8.3.0) — [release notes](https://github.com/css-modules/postcss-modules/blob/651a6b11d7185ba9e2065bf26aa09a0269f0cacf/CHANGELOG.md#830)
- The new 'none' value emits only the original class name, with no additional aliases. (8.3.0) — [release notes](https://github.com/css-modules/postcss-modules/blob/651a6b11d7185ba9e2065bf26aa09a0269f0cacf/CHANGELOG.md#830)

### Behavior and default changes

- The function form may return an array of strings; each entry is added to the locals map and resolves to the same value, enabling multiple JS-friendly aliases for one CSS class. (8.3.0) — [release notes](https://github.com/css-modules/postcss-modules/blob/651a6b11d7185ba9e2065bf26aa09a0269f0cacf/CHANGELOG.md#830)

### Fixes and other changes

- Empty rules left behind after :global unwrapping are removed instead of emitted as orphaned `{ ... }` blocks. (8.3.1) — [release notes](https://github.com/css-modules/postcss-modules/blob/651a6b11d7185ba9e2065bf26aa09a0269f0cacf/CHANGELOG.md#831)
- hashPrefix is now applied when no custom generateScopedName is set, fixing the built-in default generator silently ignoring the option. (8.3.1) — [release notes](https://github.com/css-modules/postcss-modules/blob/651a6b11d7185ba9e2065bf26aa09a0269f0cacf/CHANGELOG.md#831)

## postcss-modules 7

### Breaking changes

- Support for Node.js 10, 12, 14, and 15 was dropped; the minimum supported version is now 18. (7.0.0) — [release notes](https://github.com/css-modules/postcss-modules/blob/651a6b11d7185ba9e2065bf26aa09a0269f0cacf/CHANGELOG.md#700)
