An ESBuild plugin for handling CSS and SCSS modules with autoprefixer, BEM-like scoped class names, and full tree-shaking support. Version 0.0.4 is the latest, with active development and frequent releases. Key differentiators: integrates seamlessly with ESBuild and tsup, provides full TypeScript support, offers customizable scoped class name generation, and enables fully tree-shakable CSS for React 18 libraries. It supports CSS modules, SCSS modules, and PostCSS autoprefixer out of the box.
npm install r18cssNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to use the plugin with ESBuild and tsup, including options like custom scoped name and global prefix.
Update to v0.0.4 and remove any manual peerDependencies or modules config.
Set generateScopedName to include a hash, e.g., '[name]__[local]___[hash:base64:5]'.
Stay updated with releases.
Use import syntax or dynamic import().
Install autoprefixer as a dependency, or set skipAutoPrefixer: true.
Use only in ESBuild-based build chains.
Install sass as a devDependency if using SCSS.
Change to `import cssPlugin from 'esbuild-plugin-react18-css'`
Run `npm install autoprefixer` or set `skipAutoPrefixer: true` in options.
Use `import cssPlugin from 'esbuild-plugin-react18-css'`
Only use in esbuild or tsup configuration.
Ensure entry points reference .module.css or .module.scss files that are processed by the plugin.