This is not clear or obvious how can anyone retrieve Lightning Web Components using Ant Migration tool or mdapi:retrieve command from SFDX?

What is appropriate metadata API component which corresponds to LWC folder components in sfdx?

What should be included in package.xml?

3 Answers 3


The new Metadata API component is called LightningComponentBundle

The following XML code should be added to package.xml:


The other part of this post was about using SFDX Commands in the Terminal window of VS Code sfdx force:source:deploy -m LightningComponentBundle -u <connected/authorized org alias>

-m switch allows you to do partial deployments as opposed to building an ANT package.xml file, but beware that you ensure you've included all the dependent elements. You can deploy multiple elements with -m switch as comma delimited. Use --help for more assistance on force:source:deploy or force:mdapi:deploy


This issue has since been resolved (as of April 11, 2019) in version 7.3.0 of the Salesforce CLI. GitHub issue 1072

Here's an interesting side affect of that, at least for the moment. If you use the process here: Org Development Model with VS Code

The SFDX: Create Project with Manifest command DOES NOT include Lightning Component Bundle in the package.xml it creates. So while it will create a force-app/lwc directory it will not retrieve anything.

  • This does not appear to be valid. I just did this myself and it did infact include Lightning component bundles and Lightning web components.
    – gNerb
    Apr 25, 2019 at 15:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .