Skip to content

Latest commit

 

History

History
65 lines (42 loc) · 2.54 KB

File metadata and controls

65 lines (42 loc) · 2.54 KB

Get Started

Run a recipe in your local environment by following these steps.

Requirements

This project uses Volta to ensure that all the contributors share the same version of Node and Yarn for development. Even if you aren't contributing to this project and are running and configuring recipes for your own use only, we recommend installing Volta before you install Node and Yarn.

We use Yarn because it is significantly faster than npm for our use case. See this command cheatsheet.

Clone the Repository

git clone git@github.com:salesforce/lwr-recipes.git
cd lwr-recipes

Install Project Dependencies

yarn install

If this command fails with an error about UNABLE_TO_GET_ISSUER_CERT_LOCALLY, Error: unable to get local issuer certificate, or a registry communication issue then verify that the yarn installation was successful.

Build All LWR Recipes

yarn build

Run an LWR Recipe

Navigate to your chosen recipe and run the recipe. Using hello-world for example:

cd packages/hello-world
yarn start

Open the site at http://localhost:3000

Recipes can be started in four different modes:

Mode Start Command Format File Watch Bundling Minify
dev yarn dev ESM 🚫 🚫
prod yarn start ESM 🚫
compat yarn start:compat AMD 🚫 🚫
prod-compat yarn start:prod-compat AMD 🚫

Hot Reloading

Running a recipe in dev mode uses hot reloading for easier debugging, so when you change a component in one place it updates immediately. In dev mode, the server registers all file paths and watches them individually.

Clean an LWR Recipe

Cleaning a recipe removes the build directory and file cache. This command is useful if you run into errors or have a stale project.

yarn clean