Lit is a simple library for building fast, lightweight web components. This guide walks you through deploying Lit sites to Edgio.
Prerequisites
Before proceeding, you will need an Edgio property. Create one now if you do not already have one.
System Requirements
Sign up for Edgio
Deploying requires an account on Edgio. Sign up here for free.
Install the Edgio CLI
If you have not already done so, install the Edgio CLI.
Bash
1npm i -g @edgio/cli@latest
Create your Lit site
Clone this starter example and install dependencies:
Bash
1git clone https://github.com/edgio-docs/edgio-lit-example2yarn install
Run the Lit app locally on Edgio
Test your app with the Sites in development mode on your local machine by running the following command in your project’s root directory:
Bash
1edgio dev
Load the site http://127.0.0.1:3000
This will listen to any changes inside the folder src, with live reloads!
Run the Lit app in local production on the Sites
Create a production build using:
Bash
1edgio build
Test your app with the Sites in production mode on your local machine by running the following command in your project’s root directory:
Bash
1edgio run --production
Load the site http://127.0.0.1:3000
Deploy to the Sites
Deploy your app to the Sites by running the following command in your project’s root directory:
Bash
1edgio deploy
Your initial CDN-as-code deployment will generate system-defined origin configurations along with those defined within your
edgio.config.js
. Learn more about system-defined origins.