A plugin for esbuild that seamlessly integrates PostCSS processing into the build pipeline. Version 0.0.4, with no recent updates. It works by matching file extensions (default .css) and running PostCSS transforms via a PostCSS instance configured in your project's postcss.config.js file. Unlike postcss-cli or webpack postcss-loader, this plugin is lightweight and leverages esbuild's speed. It requires esbuild and PostCSS 8+ as peer dependencies. Note: the package uses CommonJS require() style and does not expose an ESM module, which may cause issues in ESM-only environments.
npm install esbuild-postcssVerified import paths — ran on the pinned version, not inferred.
Shows how to use the esbuild-postcss plugin: create an esbuild build with a CSS entry point and the plugin.
Use `require('esbuild-postcss')` or add a bundler transform.Create a postcss.config.js with your plugins and options.
Pass a custom `extensions` array, e.g., `postcssPlugin({ extensions: ['.css', '.pcss'] })`.Add source map support in your postcss.config.js.
Run `npm install esbuild-postcss --save-dev`
Use `import postcss from 'esbuild-postcss'` or `const postcss = require('esbuild-postcss')`Run `npm install postcss@^8.0.0`