Vite is a powerful React engine. In this guide we'll show you how to get a Vite app up and running with yarn or npm.

Benefits of Vite

  • Near instant fast refresh in dev mode.

To start: yarn create vite my-vite-app --template react.

Then run:

 cd my-vite-app
 yarn
 yarn dev

Building the Vite app for production

To build the Vite app, simply run yarn run build. This will build your app in the dist folder.

Previewing your built app in the browser

After building, you can run yarn run preview to see the built app in the browser.

Lesson 2/2