lightning dev site

Preview an Experience Builder site locally and in real-time, without deploying it.

Enable Local Dev to see local changes to your site in a real-time preview that you don’t have to deploy or manually refresh. To let you quickly iterate on your Lightning web components (LWCs) and pages, your site preview automatically refreshes when Local Dev detects source code changes.

When you edit these local files with Local Dev enabled, your org automatically reflects these changes.

  • Basic HTML and CSS edits to LWCs
  • JavaScript changes to LWCs that don't affect the component's public API
  • Importing new custom LWCs
  • Importing another instance of an existing LWC

To apply any other local changes not listed above, you must deploy them to your org using the sf project deploy start command. Then republish your site and restart the server for the Local Dev experience.

If you run the command without flags, it displays a list of Experience Builder sites that it found in your local DX project for you to choose from. Use the –name flag to bypass the question. The command also asks if you want to enable Local Dev in your org if it isn’t already.

For more considerations and limitations, see the Lightning Web Components Developer Guide.

Flag Name (Long)Flag Name (Short)Description
‑‑api‑versionN/AType: Value

Override the api version used for api requests made by this command
‑‑flags‑dirN/AType: Value

Import flag values from a directory.
‑‑name‑nType: Value

Name of the Experience Builder site to preview. It must match a site name from the current org.
‑‑target‑org‑oType: Value
Required

Username or alias of the target org. Not required if the target-org configuration variable is already set.

Select a site to preview from the org with alias “myOrg”:

Preview the site “Partner Central” from your default org: