{"id":14554,"library":"esbuild","title":"esbuild","description":"esbuild is an extremely fast JavaScript and CSS bundler and minifier. The current stable version is v0.28.0. The project maintains an active release schedule, frequently delivering patch updates and minor versions (e.g., v0.27.x, v0.28.x) within short periods, sometimes multiple per month, indicating rapid development and responsiveness to issues.","status":"active","version":"0.28.0","language":"javascript","source_language":"en","source_url":"https://github.com/evanw/esbuild","tags":["javascript","typescript"],"install":[{"cmd":"npm install esbuild","lang":"bash","label":"npm"},{"cmd":"yarn add esbuild","lang":"bash","label":"yarn"},{"cmd":"pnpm add esbuild","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"","symbol":"build","correct":"import { build } from 'esbuild'"}],"quickstart":{"code":"import { build } from 'esbuild';\n\nconst entryPoint = 'src/index.ts';\nconst outFile = 'dist/bundle.js';\n\nawait build({\n  entryPoints: [entryPoint],\n  bundle: true,\n  outfile: outFile,\n  platform: 'node',\n  target: 'es2022'\n}).then(() => {\n  console.log(`Successfully bundled ${entryPoint} to ${outFile}`);\n}).catch(() => {\n  process.exit(1);\n});","lang":"typescript","description":"Bundles a TypeScript file `src/index.ts` into `dist/bundle.js` for a Node.js environment, targeting ES2022."},"warnings":[{"fix":"Pin `esbuild` to an exact version (e.g., `\"esbuild\": \"0.28.0\"`) or use `~` for patch updates only (e.g., `\"esbuild\": \"~0.28.0\"`) in `package.json`.","message":"esbuild v0.27.0 introduced deliberate backwards-incompatible changes. Users are strongly advised to pin exact versions or use patch-only version ranges to prevent unexpected upgrades.","severity":"breaking","affected_versions":">=0.27.0"},{"fix":"Upgrade to `esbuild@0.27.7` or later.","message":"Prior to v0.27.7, esbuild might incorrectly generate class fields for TypeScript parameter properties in target environments that don't support them, leading to runtime errors.","severity":"gotcha","affected_versions":"0.27.0 - 0.27.6"},{"fix":"Upgrade to `esbuild@0.27.4` or later.","message":"esbuild versions from 0.25.11 to 0.27.3 had a regression in CSS media query parsing, specifically failing to correctly wrap `or` clauses with parentheses, resulting in malformed CSS output.","severity":"gotcha","affected_versions":"0.25.11 - 0.27.3"},{"fix":"Upgrade to `esbuild@0.25.12` or later.","message":"esbuild v0.25.11 introduced a minification regression where duplicate CSS media rules were not correctly removed, especially for rules with `<media-type> and <media-condition-without-or>` grammar.","severity":"gotcha","affected_versions":"0.25.11"}],"env_vars":null,"last_verified":"2026-04-18T00:00:00.000Z","next_check":"2026-07-17T00:00:00.000Z","problems":[{"fix":"Upgrade esbuild to version `0.27.7` or newer.","cause":"TypeScript parameter properties were incorrectly lowered for target environments that don't support class fields in esbuild versions 0.27.0-0.27.6.","error":"SyntaxError: Class field initializers are not supported by the current target environment"},{"fix":"Upgrade esbuild to version `0.27.4` or newer.","cause":"A regression in esbuild (v0.25.11 - v0.27.3) caused incorrect parsing of CSS media queries with `or` clauses, leading to invalid CSS.","error":"[ERROR] Expected \"and\", \"or\", or end of input but found \"{\""},{"fix":"Upgrade esbuild to version `0.27.1` or newer.","cause":"A bug in the bundler (prior to v0.27.1) incorrectly handled `var` declarations nested inside `if` statements when importing ES modules via `require`, leading to hoisting issues.","error":"ReferenceError: [variable_name] is not defined"}],"ecosystem":"npm"}