A minimal CSS Modules plugin for esbuild using Lightning CSS (Rust-based) for transformations. Version 0.1.2, with monthly releases. Supports the `composes` feature with dependencies (`composes: mixin from './mixin.module.css'`), which other esbuild CSS modules plugins often fail to handle correctly due to reliance on postcss-modules. Tested with ~100 CSS modules in production. Requires esbuild ~0.16.0 or ~0.17.0 as a peer dependency. Simpler than alternatives like `esbuild-css-modules-plugin` but with fewer features.
npm install esbuild-plugin-lightningcss-modulesNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to configure esbuild with the plugin, enabling CSS Modules and nesting support.
Add includeFilter: /\.css$/ to the plugin options if your CSS modules lack the .module.css extension.
Pin esbuild to 0.16.x or 0.17.x, or consider an alternative plugin that supports newer esbuild.
Set excludeFilter: /node_modules\/some-lib\/styles\.css/ to exclude global CSS.
Ensure cssModules() is added to plugins array in esbuild.build call.
Use named import: import { cssModules } from 'esbuild-plugin-lightningcss-modules'