How to retrieve specific LWC code from org

Photo by Amy Hirschi on Unsplash

How to retrieve specific LWC code from org

Table of contents

No heading

No headings in the article.

Sometimes we may have to work on the LWC which was deployed by some other. In such cases, we may not have the code on our local machine.

To pull the component's code from the org, we can use the below command

sfdx force:source:retrieve -m LightningComponentBundle:[cmpName]

Note :

  • Make sure Salesforce CLI is installed on your machine.

  • Make sure after creating the project (SFDX: Create Project), authorize the Salesforce Org. To authorize, run SFDX: Authorize an Org command in the VSCode terminal.