An optimized, type-friendly PostCSS plugin for esbuild (v0.0.9). Supports CSS preprocessors (Sass, Less, Stylus) and CSS modules out of the box. Based on esbuild-plugin-postcss but with improved TypeScript definitions and performance. Works with esbuild 0.11+. Requires peer dependencies: postcss@8.x and optionally sass, less, or stylus. Minimal configuration needed; automatically resolves postcss.config.js.
npm install esbuild-plugin-postcss2-esbuild1101No compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Bundles a CSS file with esbuild, applies Autoprefixer via PostCSS, and outputs to dist/bundle.css.
Set modules: false in options if you don't need CSS modules.
Install the required preprocessor: npm install -D sass (or less, stylus).
Use default import: import postCssPlugin from 'esbuild-plugin-postcss2' instead of import { postCssPlugin } from 'esbuild-plugin-postcss2'.Ensure postcss@8.x is installed.
Pass plugins array to postCssPlugin().
Install sass: npm install -D sass
Use default import: import postCssPlugin from 'esbuild-plugin-postcss2'
Update postcss to 8.x: npm install postcss@8
Use require() instead: const postCssPlugin = require('esbuild-plugin-postcss2')Check the modules.getJSON path or set modules to false to disable.