Apex Aide apexaide

New Lightning Local Development Server in Salesforce | Lightning Web Component

www.salesforcebolt.com· ·Intermediate ·Developer ·2 min read
Summary

The post introduces the new Local Development Server (Beta) for Lightning Web Components, enabling developers to preview their LWCs in real-time within Lightning Experience, Salesforce mobile app, or Experience Cloud LWR sites without the need to deploy or refresh manually. Available in Winter '25 sandboxes and scratch orgs, it improves productivity by updating previews automatically as changes are saved. The article provides step-by-step instructions to set up and run the local dev server, making it easier for Salesforce developers to iterate faster and test their components in a realistic environment.

Takeaways
  • Use Local Dev Server for real-time Lightning web component preview and iteration.
  • Enable Local Dev in Winter '25 sandbox or scratch org for beta access.
  • Install plugin with 'sf plugins install @salesforce/plugin-lightning-dev' command.
  • Modify project-scratch-def.json to enable Lightning preview preference.
  • Run 'sf lightning dev app' to start Local Dev Server and test LWCs locally.

With Local Dev (Beta), you can develop your Lightning web components (LWCs) in a real-time preview of your Lightning app or Experience Cloud Lightning Web Runtime (LWR) site. The preview automatically updates when you save changes to your source code, so you can iterate faster on your LWCs without deploying code or manually refreshing the preview in your browser. Who Can Access the Local Dev Beta Experience? Local Dev is available for users in Winter '25 sandboxes as an open beta, and it's turned off by default. You can also enable Local Dev for scratch orgs. With Local Dev, you can run a preview of the following types of Salesforce projects. Lightning Experience Salesforce mobile app LWR Sites for Experience Cloud Steps to install and use Local Dev Server Step 1 : Create a Winter 25 developer org using below link https://www.salesforce.

Lightning Web Components[object Object]