{"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,"search_vec":"'0.11':44 '8':49 'automat':60 'base':28 'box':27 'configur':58 'css':16,22 'definit':38 'depend':47 'esbuild':2,13,31,43 'esbuild-plugin-postcss':30 'esbuild-plugin-postcss2':1 'friend':9 'improv':36 'javascript':63 'less':19,54 'minim':57 'modul':23 'need':59 'optim':6 'option':52 'peer':46 'perform':40 'plugin':3,11,32 'postcss':10,33,48 'postcss.config.js':62 'postcss2':4 'preprocessor':17 'requir':45 'resolv':61 'sass':18,53 'stylus':20,56 'support':15 'type':8 'type-friend':7 'typescript':37,64 'v0.0.9':14 'work':41 'x':50","created_at":"2026-05-01T13:44:29.725141+00:00","updated_at":"2026-05-01T13:44:29.725141+00:00","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,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/timostamm/esbuild-plugin-postcss2","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/esbuild-plugin-postcss2-esbuild1101","openapi_spec":null,"status_page":null,"smithery":null,"categories":["web-framework","serialization"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-05-01","next_check":"2026-07-30","install_tag":null}}