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
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/)
Ruth BeaudinRuth Beaudin
It’s about time we have real decentralized apps that cant be censored by stronger power. well If you are looking for mobile app development services i think its a good place to find app develop Company. Identify your targets https://spdload.com/blog/how-to-build-crm-from-scratch/ and the strategies for digital marketing that you will use to build a CRM system from scratch
Jonathan SwiffJonathan Swiff
Sacramento Bail (https://www.atlantisbailbonds.net/) is something that must be posted by a qualified Sacramento Bail Bonds Agent (https://www.atlantisbailbonds.net/) who knows How Bail Bonds Work Sacramento (https://www.atlantisbailbonds.net/) and can offer a Bail Payment Plan in Sacramento (https://www.atlantisbailbonds.net/). Fast Bail Sacramento (https://www.atlantisbailbonds.net/) can be obtained from someone who provides 24 Hour Bail Bonds Sacramento (https://www.atlantisbailbonds.net/).


After being arrested, one must post bail (https://www.atlantisbailbonds.net/) to be released or wait to see a judge and ask for release (https://www.atlantisbailbonds.net/) on your word.
Pavlin Penchev 10Pavlin Penchev 10

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

Brian OconnellBrian Oconnell
So much spam in this thread.
Ezra Kenigsberg @ BCEzra Kenigsberg @ BC

OMG, Salesforce Advanced Code Searcher (https://chrome.google.com/webstore/detail/salesforce-advanced-code/lnkgcmpjkkkeffambkllliefdpjdklmi" target="_blank)--which was already a great utility--has an "LWC Editor" tab built right into it:

Screenshot of LWC Editor (Beta) built into Salesforce Advanced Code Searcher
Big props to Sameer Miraj and this wonderful addition (https://jungleeforce.com/category/salesforce-2/lwc/)!  

Wyatt EastWyatt East
Here you can find MVP template free (https://sloboda-studio.com/blog/how-to-build-a-minimum-viable-product/)  - an article "How to Build a Minimum Viable Product For a Startup in 2022" [Templates and Examples]
Wyatt EastWyatt East
Here you can find How to Create a Ride-Sharing App in 2022: The Definitive Guide (https://sloboda-studio.com/blog/how-to-create-a-ride-sharing-app/)
Christopher VineyardChristopher Vineyard
Thanks for sharing! If you are looking for web development services, visit this page: http://rubygarage.org/services/web-development. Their team always finds the right balance among price, quality, and project requirements so they can offer the best solution for a particular situation.