Retrieve LWC using Ant Migration tool or mdapi:retrieve command from SFDX
This is going to be a short post but very important as this is related to LWC which is a very powerful product but not much help available on Internet to the date.
This article will help us retrieving Lightning Web Components using Ant Migration tool or mdapi:retrieve command from SFDX.
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.
The new Metadata API component is called LightningComponentBundle.
The following XML code should be added to package.xml:
<types> <members>*</members> <name>LightningComponentBundle</name> </types>