{"library":"rollup-plugin-postcss-modules","title":"rollup-plugin-postcss-modules","description":"A Rollup plugin that wraps rollup-plugin-postcss with built-in CSS Modules and TypeScript support. Stable version 2.1.1, released September 2023. Provides automatic generation of .d.ts files for CSS modules, enabling type-safe imports in TypeScript projects. The only maintained fork with TypeScript integration after rollup-plugin-postcss v2 dropped CSS Modules support. Differentiator: handles named exports with class name mangling (e.g., hyphenated names become camelCase with $ prefix) and generates default export objects alongside named exports.","language":"javascript","status":"active","last_verified":"Mon Apr 27","install":{"commands":["npm install rollup-plugin-postcss-modules"],"cli":null},"imports":["import postcss from 'rollup-plugin-postcss-modules'","import type { RollupPluginPostcssModulesOptions } from 'rollup-plugin-postcss-modules'","const postcss = require('rollup-plugin-postcss-modules')"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"// rollup.config.js\nimport postcss from 'rollup-plugin-postcss-modules';\nimport typescript from '@rollup/plugin-typescript';\nimport autoprefixer from 'autoprefixer';\n\nexport default {\n  input: 'src/index.ts',\n  output: { file: 'dist/bundle.js', format: 'es' },\n  plugins: [\n    postcss({\n      extract: true,\n      writeDefinitions: true,\n      modules: { generateScopedName: '[name]__[local]___[hash:base64:5]' },\n      plugins: [autoprefixer()],\n    }),\n    typescript(),\n  ],\n};","lang":"typescript","description":"Shows basic Rollup config with CSS modules, TypeScript definition generation, and autoprefixer.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}