function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
debradebra 

Open existing Lightning Web Component using Visual Studio Code app?

I am VERY new to LWC development and having issue opening a previously created LWC from my Org using Visual Studio Code.   I do not have this code yet in any folder on my system just want to connect to the org and pull down the code for pre-existing LWCs.
I did install Salesforce in Visual Studio Code but not sure how to use it once it's installed

Any tips are appreciated.  
Most of my old experience was with Apex/VF and Eclipse IDE.
Best Answer chosen by debra
GauravGargGauravGarg
Hi Debra, 

Follow the below steps:
  1. "Create a Project with Manifest" in VS code (folder to store the files) 
  2. Authorise an Org (connect the org where you already have LWC components)
  3. Go to Manifest Folder --> Right click --> Refresh component from Source using Manifest
This will refresh the VS Code and get all the existing LWC Components from the connected Org. 

If you have components in Multiple org, "Authorise an org" multiple times and refresh it.

At last, you can set Default org to deploy all the changes into one org instead of placing them in multiple org. 

Hope this helps. 

Thanks,
Gaurav
Skype: gaurav62990

All Answers

GauravGargGauravGarg
Hi Debra, 

Follow the below steps:
  1. "Create a Project with Manifest" in VS code (folder to store the files) 
  2. Authorise an Org (connect the org where you already have LWC components)
  3. Go to Manifest Folder --> Right click --> Refresh component from Source using Manifest
This will refresh the VS Code and get all the existing LWC Components from the connected Org. 

If you have components in Multiple org, "Authorise an org" multiple times and refresh it.

At last, you can set Default org to deploy all the changes into one org instead of placing them in multiple org. 

Hope this helps. 

Thanks,
Gaurav
Skype: gaurav62990
This was selected as the best answer
debradebra
Thanks Gaurav!!
Pavlin Penchev 10Pavlin Penchev 10

Debra, Gaurav,

This is a useful discussion! I followed the steps above and managed to retrieve data from my org but I can't figure out how to edit (and find in the first place) the Article Content component that displays Salesforce Articles (part of the Knowledge product) on Communities/Sites. I need access to the HTML and JavaScript, I think, to tweak the behaviour of images displayed as part of the 'Article Content' component. I am not finding the component in question under the LWC folder, nor anywhere else (components, pages folders etc). Is this possible at all?

User-added image

Varshit Bhatia 29Varshit Bhatia 29
 I didnt see exactly this "Refresh component from Source using Manifest". Instead inside manifest I opened package.xml and then right clicked and then clicked on "Retrieve Source in Manifest from Org". Ensure "LightningComponentBundle" is present in your org to retireve LWC components and "AuraDefinitionBundle" is present in package.xml to retrieve Aura components.