unstale

npm / postcss-modules

postcss-modules

What changed in postcss-modules 7 to 9, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-19.

2 breaking7 new APIs and options1 behavior and defaults3 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli 0.2.0 on npm

postcss-modules 97 changes

Breaking changes 1

  • The minimum Node.js version is now 20.6, the release that stabilized module.register.

    9.0.0release notes

New APIs and options 5

  • Run Node with the loader imported to enable CSS imports that return the class-name token map.

    9.0.0release notes

  • Loader options can also be supplied under a postcss-modules key in package.json, using the same shape as the PostCSS plugin.

    9.0.0release notes

  • The environment variable is an additional location for loader options.

    9.0.0release notes

  • 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.0release notes

  • Loader options can be configured in this file in the current working directory, using the same shape as the PostCSS plugin.

    9.0.0release notes

Fixes and other changes 1

  • Added a type declaration so TypeScript users can extend the loader with declare module without hitting a type error.

    9.0.1release notes

postcss-modules 85 changes

New APIs and options 2

  • The new 'all' value emits the original class name plus camelCase and dashes-camelCase variants in one pass.

    8.3.0release notes

  • The new 'none' value emits only the original class name, with no additional aliases.

    8.3.0release notes

Behavior and default changes 1

  • 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.0release notes

Fixes and other changes 2

  • Empty rules left behind after :global unwrapping are removed instead of emitted as orphaned { ... } blocks.

    8.3.1release notes

  • hashPrefix is now applied when no custom generateScopedName is set, fixing the built-in default generator silently ignoring the option.

    8.3.1release notes

postcss-modules 71 changes

Breaking changes 1

  • Support for Node.js 10, 12, 14, and 15 was dropped; the minimum supported version is now 18.

    7.0.0release notes