+ Start a Discussion
Jordan MJordan M 

Editing Lightning Web Component

I am new to LWC and cant seem to figure out how to open the source code for LWC. Aura can be opened in the dev console but from what i understand this is not possible with LWC.

Is it possible to open a LWC source code from within the org? I have a LWC that was developed by someone else that needs editing. How can I access the source code?
Best Answer chosen by Jordan M
Soyab HussainSoyab Hussain
Hi Jordan Mathews,

Step 1. Go to workbench and login.

https://workbench.developerforce.com/login.php

Step 2.  Click on retrieve button.

User-added image
Step 3. click on "Choose File" button and upload package.xml file.

package.xml:
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>*</members>
        <name>LightningComponentBundle</name>
    </types>
    <version>45.0</version>
</Package>

Step 4. click on next and retrieve metadata, it will give you all the LWC components exist in your org.

User-added image

Step 5. click Download ZIP File.

Regards,
Soyab

All Answers

Danish HodaDanish Hoda
Hey Jordan. One way is to "Right click - > Inspect" on the page.
Jordan MJordan M
Thanks for your response Danish. This allows me to view to source the source code and edit it in the browser. But I am wanting to open the code for the componenet in code editor(VS code), edit it, and then push the changes to the org.. I didnt create the orginal component so i dont have the the original files. Is this something simple that I am overlooking? 
Danish HodaDanish Hoda
Hi Jordan,
You can create a new project with Manifest in VS code. After authorizing your org, retrieve metadata from Org, you will get the whole code in force-app --> main --> default --> lwc.

The manifest file should be like : 

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>*</members>
        <name>ApexClass</name>
    </types>
    <types>
        <members>*</members>
        <name>ApexComponent</name>
    </types>
    <types>
        <members>*</members>
        <name>ApexPage</name>
    </types>
    <types>
        <members>*</members>
        <name>ApexTestSuite</name>
    </types>
    <types>
        <members>*</members>
        <name>ApexTrigger</name>
    </types>
    <types>
        <members>*</members>
        <name>AuraDefinitionBundle</name>
    </types>
    <types>
        <members>*</members>
        <name>LightningComponentBundle</name>
    </types>
    <types>
        <members>*</members>
        <name>StaticResource</name>
    </types>
    <version>46.0</version>
</Package>
Soyab HussainSoyab Hussain
Hi Jordan Mathews,

Step 1. Go to workbench and login.

https://workbench.developerforce.com/login.php

Step 2.  Click on retrieve button.

User-added image
Step 3. click on "Choose File" button and upload package.xml file.

package.xml:
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>*</members>
        <name>LightningComponentBundle</name>
    </types>
    <version>45.0</version>
</Package>

Step 4. click on next and retrieve metadata, it will give you all the LWC components exist in your org.

User-added image

Step 5. click Download ZIP File.

Regards,
Soyab
This was selected as the best answer
Jordan MJordan M
Thank you Soyab Hussain!
Danny Sk 6Danny Sk 6
Thanks Danish but I don't know how to use Manifest in VS code.
viva tvviva tv
use this viva tv apk (https://vivatvapk.me) for watch movies and tv shows across world
hindi songhindi song
This is the best site for the latest men's fashion watches and sunglasses (https://menfashionplace.com/). buy the latest men's clothes from this site. You can also buy sunglasses for mens (https://menfashionplace.com/).
hindi songhindi song
if you want ot buy the best laptops under 40000 in india (https://www.bestlaptoptry.com/2020/03/best-laptops-under-40000.html) then this site is the best for you. this site has the best laptop deals and accessories (https://www.bestlaptoptry.com/) for laptops and computer. best laptops to buy (https://www.bestlaptoptry.com/).
hindi songhindi song
For your kind information, this site is the best on the internet to read the latest song lyrics (https://songslyricsfree.com/). latest and Hindi song lyrics. (https://songslyricsfree.com/)
ravi sharma 148ravi sharma 148
This is most popular movie website download any movie easy visit this website hdmovieshub (https://hdmovieshub.buzz/) Very helpful information.
Himanshu Mishra 2Himanshu Mishra 2
Thank you for the solution Was looking for it for Clearcycle (https://clearcycle.com)
Himanshu Mishra 2Himanshu Mishra 2
Can it work for Disbursement Management (https://managedisbursement.wordpress.com/)
Arsalan PervezArsalan Pervez
Thank you for sharing such information. Image Manipulation Services (https://it-s.com/our-services/image-editing/image-manipulation/)