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
- Yarn
- pnpm
npm install @roots/bud-swc --save-dev
yarn add @roots/bud-swc --dev
pnpm add @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
- Yarn
- pnpm
npm install @roots/bud-typescript --save-dev
yarn add @roots/bud-typescript --dev
pnpm add @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
- Yarn
- pnpm
npm install @roots/bud-esbuild --save-dev
yarn add @roots/bud-esbuild --dev
pnpm add @roots/bud-esbuild --save-dev