Skip to content
Back to blog

Publish an npm package with esbuild and TypeScript

October 2, 2022

Publish an npm package with esbuild and TypeScript

Key takeaways

This guide targets esbuild npm and npm esbuild searches with a complete publishing path for a TypeScript library.

  • >Structure an npm package with TypeScript and exports.
  • >Use esbuild for fast JavaScript bundles.
  • >Prepare npm publication without breaking package consumers.

Quick FAQ

Is esbuild good for publishing an npm library?

Yes for fast JavaScript builds. Pair it with tsc for declaration files and verify package.json exports.

Should an npm package publish source or only bundles?

Publish the bundle, type declarations, and runtime files. main, module, types, and exports should point to stable outputs.

Book a call