Retrieve LWC using package.xml

How to retrieve LWC with package.xml / manifest file

Summery:

  1. Retrieve Single LWC
  2. Retrieve Multiple Lightning Web Components
  3. Retrieve All LWC
  4. Fetch LWC with SFDX
Retrieve LWC with menifest file

Retrieve Single LWC

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

Fetch multiple LWC

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

Retrieve All * LWC

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

Retrieve LWC with SFDX

sfdx force:source:retrieve -m LightningComponentBundle:lookupComponent

Leave a Reply