Create and Deploy a Preact App with Vercel

Create your Preact app and deploy it with Vercel.

Check out the Live Demo or...

Preact is a fast 3kB alternative to React with the same modern API.

In this guide, we will cover how to set up a Preact app with Preact CLI and how to deploy it with Vercel.

Step 1: Set Up Your Preact Project

If you do not have the Preact CLI installed currently, use the following command to install it globally:

npm i -g preact-cli

Installing Preact CLI globally with npm.

Get started by setting up a Preact app with Preact CLI and the following command:

preact create default my-preact-app && cd my-preact-app

Bootstrapping a Preact app with Preact CLI.

Step 2: Deploying Your Preact Project with Vercel

To deploy your Preact app with Vercel for Git, make sure it has been pushed to a Git repository.

Import the project into Vercel using your Git provider of choice:

After your project has been imported, all subsequent pushes to branches will generate Preview Deployments, and all changes made to the Production Branch (commonly "main") will result in a Production Deployment.

Once deployed, you will get a URL to see your app live, such as the following:

Set up a Preact app with a few clicks using the Deploy button, and create a Git repository for it in the process for automatic deployments for your updates.

Written By
Written by mcsdevmcsdev