lwr start|preview

To preview your site in its target environment after you successfully run lwr build, run lwr start or lwr preview.

If you run this command without a prebuilt directory, it’ll default to the standard LWR standalone server and it won’t use any statically generated content.

OptionTypeRequired/OptionalDescription
-p, --port <port>NumberOptionalSet the port for the local development server. If a port isn’t specified, the default value is 3000.
-m, --mode <mode>StringOptionalSet the server mode. If a server mode isn’t specified, the default value is dev. Accepted values are dev, compat, prod-compat, and prod.
-t, --target <target>StringOptionalSet the site deployment target. If a target isn’t specified, the default value is default. Accepted values are:
  • default - Generates the static site wouthout any configuration options.
  • mrt - Generates the static site with a Managed Runtime configuration.
  • netlify - Generates the static site with a Netlify configuration.
-b, -buildDir <directory>StringOptionalSpecify the prebuilt directory for your static site.
-o, --openBooleanOptionalOpen the static site in the browser on startup. By default, the browser doesn’t open on startup.
-h, --helpOptionalView help text for lwr start and lwr preview options in the CLI.

Developer Preview Feature

Feature is available as a developer preview. Feature is not generally available unless or until Salesforce announces its general availability in documentation or in press releases or public statements. All commands, parameters, and other features are subject to change or deprecation at any time, with or without notice. Do not implement functionality developed with these commands or tools.

DID THIS ARTICLE SOLVE YOUR ISSUE?
Let us know so we can improve!