New Lightning Local Development Server in Salesforce | Lightning Web Component


 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  

Step 2 : Enable the Dev Hub

Step 3 : Create a Scratch Org

Step 4 : Install the local dev server using this command "sf plugins install @salesforce/plugin-lightning-dev"

Step 5 : Enable Local Dev Server -- > Quick Find --> Local Dev

Step 6 : In your SFDX project, open the file config/project-scratch-def.json.
In the settings section of the file, add the key "enableLightningPreviewPref" and set it to true, like this:



step 7 : Run this command in terminal and enjoy the show "sf lightning dev app"

Your environment will be getting below message at the top if you have installed it successfully.



I have used below component to test it in the video tutorial : 


Output

Checkout the video tutorial below


 If you have any question please leave a comment below.

If you would like to add something to this post please leave a comment below.
Share this blog with your friends if you find it helpful somehow !

Thanks
Happy Coding :)

Post a Comment

0 Comments