{"id":25385,"library":"esbuild-plugin-postcss2-esbuild1101","title":"esbuild-plugin-postcss2","description":"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.","status":"active","version":"0.0.9","language":"javascript","source_language":"en","source_url":"https://github.com/timostamm/esbuild-plugin-postcss2","tags":["javascript","typescript"],"install":[{"cmd":"npm install esbuild-plugin-postcss2-esbuild1101","lang":"bash","label":"npm"},{"cmd":"yarn add esbuild-plugin-postcss2-esbuild1101","lang":"bash","label":"yarn"},{"cmd":"pnpm add esbuild-plugin-postcss2-esbuild1101","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core peer dependency for PostCSS processing","package":"postcss","optional":false},{"reason":"Required for Sass/SCSS preprocessing","package":"sass","optional":true},{"reason":"Required for Less preprocessing","package":"less","optional":true},{"reason":"Required for Stylus preprocessing","package":"stylus","optional":true}],"imports":[{"note":"Package supports both ESM and CJS; default export is the plugin function.","wrong":"const postCssPlugin = require('esbuild-plugin-postcss2')","symbol":"default","correct":"import postCssPlugin from 'esbuild-plugin-postcss2'"},{"note":"Options is a type export, not a value. Use `import type` in TypeScript.","wrong":"import { Options } from 'esbuild-plugin-postcss2'","symbol":"Options","correct":"import type { Options } from 'esbuild-plugin-postcss2'"},{"note":"There is no named export; only default export.","wrong":"","symbol":"PostCSSPlugin","correct":"import postCssPlugin from 'esbuild-plugin-postcss2'"}],"quickstart":{"code":"import esbuild from 'esbuild';\nimport postCssPlugin from 'esbuild-plugin-postcss2';\nimport autoprefixer from 'autoprefixer';\n\nawait esbuild.build({\n  entryPoints: ['src/index.css'],\n  outfile: 'dist/bundle.css',\n  bundle: true,\n  plugins: [\n    postCssPlugin({\n      plugins: [autoprefixer],\n    }),\n  ],\n});\nconsole.log('Build complete.');","lang":"typescript","description":"Bundles a CSS file with esbuild, applies Autoprefixer via PostCSS, and outputs to dist/bundle.css."},"warnings":[{"fix":"Set modules: false in options if you don't need CSS modules.","message":"CSS modules are enabled by default. If you don't want CSS modules, you must explicitly set modules: false.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Install the required preprocessor: npm install -D sass (or less, stylus).","message":"Preprocessors (Sass, Less, Stylus) are not automatically installed. You must add them as devDependencies yourself.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Use default import: import postCssPlugin from 'esbuild-plugin-postcss2' instead of import { postCssPlugin } from 'esbuild-plugin-postcss2'.","message":"The export from 'esbuild-plugin-postcss2' changed from a named export to a default export in v0.0.4.","severity":"deprecated","affected_versions":">=0.0.1 <0.0.4"},{"fix":"Ensure postcss@8.x is installed.","message":"Peer dependency postcss changed from ^7.x to 8.x in v0.0.6.","severity":"breaking","affected_versions":">=0.0.6"},{"fix":"Pass plugins array to postCssPlugin().","message":"The plugin does not automatically resolve postcss.config.js. You must pass PostCSS plugins manually or configure via options.","severity":"gotcha","affected_versions":">=0.0.1"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Install sass: npm install -D sass","cause":"Sass is not installed even though it's a peer dependency.","error":"Error: Cannot find module 'sass'"},{"fix":"Use default import: import postCssPlugin from 'esbuild-plugin-postcss2'","cause":"Using named import instead of default import in older versions.","error":"TypeError: postCssPlugin is not a function"},{"fix":"Update postcss to 8.x: npm install postcss@8","cause":"peer dependency version mismatch (postcss 7.x installed).","error":"Error: PostCSS plugin requires PostCSS 8.x"},{"fix":"Use require() instead: const postCssPlugin = require('esbuild-plugin-postcss2')","cause":"Using ESM syntax in a CommonJS project without type:module.","error":"Error: Cannot use import statement outside a module"},{"fix":"Check the modules.getJSON path or set modules to false to disable.","cause":"CSS modules output path is incorrect or not writable.","error":"Error: [postcss-modules] No such file or directory"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}