Create and Deploy a Preact App with ZEIT Now

Create your Preact app and deploy it with ZEIT Now.

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 ZEIT Now.

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 ZEIT Now

There are two ways to deploy with ZEIT Now. We recommend using a ZEIT Now for Git Integration for ease-of-use. Alternatively, Now CLI can be used to generate a manual Preview Deployment.

Once deployed, you will get a URL to see your app live, such as the following: https://preact.now-examples.now.sh


To deploy your Preact app with a ZEIT Now for Git Integration, make sure your created project has been pushed to a Git repository.

Import the project into ZEIT Now using your Git integration of choice:

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

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 msweeneydevmsweeneydev