Step1: Open Visual Studio Code

Press Command + Shift + P on macOS or Ctrl + Shift + P on Windows or Linux, then type Create Lightning Web Component Press Enter.

Provide LWC name (firstLWC) and Press Enter. 

VSC-LWC

Step 2: LWC folder and files

LWC folder mainly contains 4 files,

  • html is to write UI display elements
  • js is to write logic and js components 
  • xml is to define lwc related metadata.
  • css is to define the css components
LWC-htmlfile

Step 3: Deployment

Right Click on any file and select “SFDX: Deploy This Source To Org”

On successful deployment, you should be able to see message like this 

References

Leave a Reply