NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #4576 most downloaded on npm
PostCSS plugin to use CSS Modules everywhere
Last release 2 months ago
10 Jul 2026
Release timing varies
gaps range from 1 weeks to 2.0 years
Nearly every release is documented
notes for 50 of 51 stable releases
Nothing withdrawn
no release was ever pulled
11 years old
51 releases · first in 2015
Added a type declaration for postcss-modules/loader so TypeScript users can extend it with declare module without hitting a type error. #172 by @sapph
postcss-modules/loader so TypeScript users can extend it with declare module without hitting a type error. #172 by @sapphi-redMinimum Node.js bumped from 20 to 20.6, the release that stabilized module.register.
module.register.postcss-modules/loader subpath — an opt-in Node module-customization hook. Run with node --import postcss-modules/loader app.mjs and JavaScript files can do import styles from "./button.css" to receive the class-name token map as the default export, mirroring css-loader's modules workflow. Options live in postcss-modules.config.{js,cjs,mjs} in cwd, the POSTCSS_MODULES_CONFIG env var, or a "postcss-modules" key in package.json, and accept the same shape as the PostCSS plugin. Aimed at non-bundler use cases (SSR, Node scripts, Jest/Vitest in node mode); bundler users keep using their existing integrations. #80One column per quarter.
hashPrefix is now applied when no custom generateScopedName is set. Previously the option was only honoured by generic-names, so the built-in default
hashPrefix is now applied when no custom generateScopedName is set. Previously the option was only honoured by generic-names, so the built-in default generator silently ignored it. #160:global { ... } unwrapping (e.g. a Sass block containing only a multi-line comment) are now removed instead of emitted as orphaned { ... } blocks. #136New localsConvention value 'all' — emit the original class name plus the camelCase and dashes-camelCase variants in one pass.
localsConvention value 'all' — emit the original class name plus the camelCase and dashes-camelCase variants in one pass.localsConvention value 'none' — emit only the original class name, with no additional aliases.localsConvention may now return an array of strings. Every entry in the array is added to the locals map and resolves to the same value, which makes it easy to expose a single CSS class under multiple JS-friendly aliases.Adapted from the unmerged work in #154 by @CarbonORM.
Pinned transitive file-type to v22 via overrides to silence @swc/cli's vulnerable dependency chain.
@swc/cli compiles src/ to build/, @swc/jest transforms test files, and ESLint now uses its default espree parser. Removed five @babel/* devDependencies and the unused @babel/register runtime hook. The published build/*.js keeps the same module.exports = (opts) => ...; module.exports.postcss = true shape, so existing CommonJS consumers are unaffected.file-type to v22 via overrides to silence @swc/cli's vulnerable dependency chain.Bumped jest from 26 to 30 to drop vulnerable node-notifier, sane, and jsdom chains
form-data, lodash, @babel/core, @babel/plugin-transform-modules-systemjs, uuid, picomatch, flatted, minimatch, qs, js-yaml, nanoid)jest from 26 to 30 to drop vulnerable node-notifier, sane, and jsdom chainspretty-format serializer (cosmetic only; emitted CSS and JSON are unchanged)Updated dependencies by Bill Collins (@mrginglymus)
The resolve option has two parameters now and can return null. Thanks to Rene Haas (@KingSora) https://github.com/madyankin/postcss-modules/commit/86d
The resolve option has two parameters now and can return null. Thanks to Rene Haas (@KingSora)
https://github.com/madyankin/postcss-modules/commit/86d8135cb5014d0b2848ef395608ee74d82bd179
Parameters:
file — a module we want to resolveimporter — the file that imports the module we want to resolveReturn value: string | null | Promise<string | null>
postcss([
require("postcss-modules")({
resolve: function (file, importer) {
return path.resolve(
path.dirname(importer),
file.replace(/^@/, process.cwd()
);
},
}),
]);
icss-replace-symbols replaced with with icss-utils by Jason Quense (@jquense). The updated replacer works better and will replace values in selectors, which didn't work until now. https://github.com/madyankin/postcss-modules/pull/145Fixed composes on Windows by @sapphi-red https://github.com/madyankin/postcss-modules/pull/135
composes on Windows by @sapphi-red https://github.com/madyankin/postcss-modules/pull/135Fixed errors when using shorthand selectors by Felix Bruns (@fxb) https://github.com/madyankin/postcss-modules/pull/130
Updated the generic-names dependency to reduce packages size by Bogdan Chadkin (@TrySound) https://github.com/madyankin/postcss-modules/pull/129
generic-names dependency to reduce packages size by Bogdan Chadkin (@TrySound) https://github.com/madyankin/postcss-modules/pull/129- Fix the build
Fixed the resolve option behaviour by @kamilic https://github.com/madyankin/postcss-modules/pull/127
resolve option behaviour by @kamilic https://github.com/madyankin/postcss-modules/pull/127Added the resolve option to configure lookup paths for composes/from by @kamilic https://github.com/madyankin/postcss-modules/pull/126
resolve option to configure lookup paths for composes/from by @kamilic https://github.com/madyankin/postcss-modules/pull/126- Fixed package contents
Fixed TypeScript typings by Shuman Lim (@origin-master) https://github.com/madyankin/postcss-modules/pull/124
Added TypeScript typings by Shuman Lim (@origin-master) https://github.com/madyankin/postcss-modules/pull/123
Upgraded to PostCSS 8 by Evan You (@yyx990803) https://github.com/css-modules/postcss-modules/pull/114
Fixed user plugins order by Tom Jenkinson (@tjenkinson) https://github.com/css-modules/postcss-modules/pull/112
Fixed an issue when some plugins were running multiple times by Tom Jenkinson (@tjenkinson) https://github.com/css-modules/postcss-modules/pull/111
[localsConvention option] now supports a custom function (originalClassName: string, generatedClassName: string, inputFile: string) => className: stri
localsConvention option] now supports a custom function (originalClassName: string, generatedClassName: string, inputFile: string) => className: string by Gregory Waxman (@Akkuma) https://github.com/css-modules/postcss-modules/pull/109### Added - Added exportGlobals option
exportGlobals optionDropped css-modules-loader-core dependency
css-modules-loader-core dependency`localsConvention` option by Hamza Mihai Daniel (@allocenx) ,
localsConvention option by Hamza Mihai Daniel (@allocenx) https://github.com/css-modules/postcss-modules/pull/103, https://github.com/css-modules/postcss-modules/issues/93camelCase camelCase removed, use the localsConvention option instead.Added hashPrefix option by Jesse Thomson (@jessethomson)
hashPrefix option by Jesse Thomson (@jessethomson) https://github.com/css-modules/postcss-modules/pull/98Rebublished the previous release. Sorry :(
Added export for other plugins by Evilebot Tnawi (@evilebottnawi) ,
Nothing published for this version
- Updated dependecies - Added prettier to format code
Added option to transform classes to camelCase by Igor Ribeiro (@igor-ribeiro)
Added ability to transmit outputFileName into getJSON by @lutien
- Dropped support for Node < 6 - Updated dependencies
Updated PostCSS to 6 by Alexey Litvinov (@sullenor)
Allowed empty string as opts.root by Sharon Rolel (@Mosho1)
Allow async getJSON by Philipp A. (@flying-sheep)
Added the root option to pass the root path by Sharon Rolel (@Mosho1) ( )
root option to pass the root path by Sharon Rolel (@Mosho1) (https://github.com/css-modules/postcss-modules/pull/55)Fixed regression in isValidBehaviour function ( )
isValidBehaviour function (https://github.com/css-modules/postcss-modules/issues/53)Refactored getDefaultPluginsList function
getDefaultPluginsList functionFixed generateScopedName bug with multiple postcss-modules instances ( )
generateScopedName bug with multiple postcss-modules instances (https://github.com/css-modules/postcss-modules/issues/37)Added globalModulePaths option (Thanks to @pospi).
globalModulePaths option (Thanks to @pospi).- Updated dependencies
Fixed sorting for composed dependencies by Josh Johnston (@joshwnj) ( )
Added scopeBehaviour option ( )
scopeBehaviour option (https://github.com/css-modules/postcss-modules/issues/22)generateScopedName (https://github.com/css-modules/postcss-modules/issues/21)Fixed processing errors capturing by Boris Serdiuk (@just-boris)
Added support for custom loaders by Björn Brauer (@ZauberNerd)
Fixed processing for imported CSS
Fixed JSON export with shallow imports ( )
Fixed failing on comments by @dfreeman ( )
Fixed failing on comments by @dfreeman (https://github.com/outpunk/postcss-modules/pull/14)
Fixed module export for ES5 ( )
Fixed module export for ES5 (https://github.com/outpunk/postcss-modules/issues/9)
Call getExports only for top level css
Call getExports only for top level css
Initial version
Initial version
Your coding agent can read these notes before it upgrades. Set up the MCP server →