Skip to main content

Adding TypeScript

Installing bud.js dependencies

There are a few options to add support for TypeScript to your application. We recommend the @roots/bud-swc extension.

npm install @roots/bud-swc --save-dev

Other options

@roots/bud-typescript

@roots/bud-typescript adds TypeScript support using the official TypeScript compiler. The extension supports JavaScript and TypeScript with zero configuration.

npm install @roots/bud-typescript --save-dev

If you want to do type checking during compilation this is probably the best option.

@roots/bud-esbuild

Experimental

This extension should be considered experimental. Not all features may work. In particular hot module replacement.

@roots/bud-esbuild adds TypeScript support using esbuild. The extension supports JavaScript and TypeScript with zero configuration.

npm install @roots/bud-esbuild --save-dev