5

I want to create a Lightning Web Component (LWC) that be included in a managed package. Our current process uses SublimeText and Mavensmate (which I know is deprecated). We also use GitHub as our repository to move code and it is deployed using CircleCI. We don't want to re-do our entire set up because this LWC is only a small part of the larger package.

However, every tutorial I've seen for LWC uses SalesforceDX to set it up. Is there a way to create a LWC without SalesforceDX? I understand that Mavensmate doesn't support LWCs but are there other options? I'm even willing to use the Developer Console if needed.

1

3 Answers 3

7

You don't need SFDX at all (yes, even Salesforce CLI is not needed). It's fully supported by Metadata API.

Personally I'm using Illuminated Cloud plugin for deploying/retrieving LWCs but it's also possible to use Ant Migration Tool to do that (or other tool that's currently supporting deployments at API 45)

Add to yours package.xml:

<types>
    <members>*</members>
    <name>LightningComponentBundle</name>
</types>

Its available since API 45.

There is one limitation though as @Jayant Das mentioned. You cannot use Developer Console to create them.

Docs

2
  • +1. I was not aware of the Metadata API support already available.
    – Jayant Das
    Commented Jun 10, 2019 at 17:46
  • Its good to know that its supported by the Metadata API. Our CircleCI uses the Ant Migration Tool and so I just used that to create it after adding those lines it to the page. I did end up use the Salesforce CLI just to get the proper directory structure.
    – Rozgonyi
    Commented Jun 11, 2019 at 15:05
0

UPDATE: Updated the answer to reflect Metadata API support for LWC.


You don't need the full fledged Salesforce DX here. To be able to use LWC, you can use the following.

  • Salesforce CLI. To be able to create projects, move components from sandbox to sandbox
  • Metadata API. If not using CLI, you can use this to move components from sandbox to sandbox
  • A code editor (preferably VS Code). You cannot use Developer Console to develop LWCs.

The following documentation provide more details on this topic:

0

I personally use VSCode. It is very easy to setup if you follow these steps to install it with all of the salesforce supported extensions https://forcedotcom.github.io/salesforcedx-vscode/articles/getting-started/install. Then, link your ORG(NOT scratch org, your sandbox or prod org) following these steps https://forcedotcom.github.io/salesforcedx-vscode/articles/getting-started/install I hope this helps.

You must log in to answer this question.

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