Skip to content

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Preact TS with Bun runtime

This is a simple template for starting a Preact project bootstrapped with Bun, with TypeScript instead of the default JavaScript configuration.

It uses Bun's built-in dev server and bundler — no Vite, webpack, or extra build tooling. Bun serves index.html directly, transpiles TypeScript/JSX and bundles CSS and assets out of the box, with hot module reloading in development.

Getting Started

Scaffold a new project

To create a TS Preact project with Bun:

bun create johanneslil/bun-preact-ts ./bun-preact-ts-app

To create a regular JS Preact project with bun:

bun create preact ./bun-preact-app

Development

Install dependencies, then start the development server.

bun install
bun run dev

Open http://localhost:3000 with your browser to see the result.

You can start editing the page by modifying src/app.tsx. The page auto-updates as you edit the file (HMR).

Production build

bun run build

The bundled, minified output is written to dist/.

Type checking

bun run typecheck

Learn More

To learn more about the tools used in this template, take a look at the following resources:

You can check out the Preact GitHub repository and the Bun GitHub repository - your feedback and contributions are welcome!

About

Because "bun create preact --typescript" is not a thing apparently

Topics

Resources

Stars

14 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages