최근 수정 시각 : 2025-10-17 12:55:41

esbuild

<colcolor=#000,#000><bgcolor=#ffcf00,#ffcf00> esbuild
파일:esbuild-wordmark.svg파일:esbuild-wordmark-dark.svg
<colbgcolor=#ffcf00,#ffcf00> 종류 JavaScript 번들러
최초 개발자 Evan Wallace
출시 2020년
안정 버전 v0.25.6 (2025년 7월 7일)
개발 언어 Go
라이선스 MIT 라이선스
링크 파일:GitHub 아이콘.svg파일:GitHub 아이콘 화이트.svg
1. 파생 소프트웨어2. 기타3. 관련 문서

1. 파생 소프트웨어

  • Vite - ESBuild를 쓰는 번들러로 널리 알려져 있지만 실제로는 transform이나 deps pre-bundle 스텝 등에서만 사용하고 실제 번들러 백엔드는 Rollup을 사용하며, 이게 기존의 Rollup 플러그인을 Vite에서도 사용할 수 있는 이유이다. 현재는 create-viteSWC 옵션이 추가되기도 했고, 아예 Rolldown을 개발하며 점점 더 ESBuild에서 멀어져가는 추세이다.[1][2][3]
  • tsx[4]
  • tsup[5] - 사실 SWC 백엔드도 지원한다. emitDecoratorMetadata를 사용하면 자동으로 SWC를 사용해 빌드한다.[6]

2. 기타

  • SWC#와 다르게, emitDecoratorMetadata를 전혀 지원하지 않는다.[7]
  • 기본적으로 Go로 노출되는 API surface는 플러그인 인터페이스(api.Plugin) 기반이기 때문에 각 기능이 step별로 완벽히 모듈화되어 있지는 않다. build.OnResolve 등으로 ESM depsgraph 등만 찾는 과정도 마지막의 bundle step을 거친다. 플러그인 중간에 훅을 넣어 대부분의 단계를 skip 가능한 Rollup과의 차이. 그래도 전반적인 확장성은 Rollup과 비슷한 수준이다. 전반적으로 Go Plugin API단에서 확장성이 살짝 부족한 감이 있다.#
  • --keep-names 옵션을 사용하는 경우 minification 등 심볼 리네임 과정에서 함수나 클래스의 원래 이름을 보존하기 위해 __name() 함수를 삽입하는데, Web Worker나 Puppeteer, Playright같은 multi-context 라이브러리 환경에서 콜백을 단지 .toString()해서 넘기는 경우(실제로 안티패턴이 맞다.), __name() 함수를 찾지 못하는 이슈가 흔하게 발생한다.### 빌드 프로세스에서 symbol rename이 발생하지 않으면 __name()을 삽입하지 않도록 제안하는 이슈가 열려 있지만 진전은 없는 편.##

3. 관련 문서



[1] Dependency pre-bundling only applies in development mode, and uses esbuild to convert dependencies to ESM. In production builds, @rollup/plugin-commonjs is used instead. #[2] Vite uses esbuild to transpile TypeScript into JavaScript which is about 20~30x faster than vanilla tsc, and HMR updates can reflect in the browser in under 50ms. #[3] While Vite leverages esbuild to pre-bundle some dependencies in dev, Vite does not use esbuild as a bundler for production builds. Vite's current plugin API isn't compatible with using esbuild as a bundler. In spite of esbuild being faster, Vite's adoption of Rollup's flexible plugin API and infrastructure heavily contributed to its success in the ecosystem. #[4] tsx uses esbuild to compile TypeScript and ESM #[5] Bundle your TypeScript library with no config, powered by esbuild. #[6] When you use legacy TypeScript decorator by enabling emitDecoratorMetadata in your tsconfig, tsup will automatically use SWC to transpile decorators. #[7] The emitDecoratorMetadata flag is intentionally not supported. It relies on running the TypeScript type checker, which relies on running the TypeScript compiler, which is really slow. Given that esbuild's primary purpose is speed, I will not be integrating the TypeScript compiler into esbuild. #