I created a LWC that contains html, js and Apex. I know how to use change sets to migrate Visualforce but I am not sure how to push JS and HTML to Production. Is this possible using Change Sets?
2 Answers
You're already using VS Code, so just deploy it from there:
sfdx force:source:deploy -l RunLocalTests -p force-app/main/default/lwc/lWC_PriceBooks -w 10 -u production
Where:
-l RunLocalTests
will specify that all tests should run, if necessary, you may want to change this.-p force-app/main/default/lwc/lWC_PriceBooks
is the path to the files to deploy.-w 10
specifies a wait time of 10 minutes (if you have large deploys, you may adjust this).-u production
is an alias to your production org where you want the code.
There's no need to get the Sandbox/Scratch Org involved at all, and since Change Sets can take significant time to upload, this saves you all the intermediate steps.
You may also want to look at Unlocked Packages in the future, they are really easy to use and provide more control over how you manage your metadata.
Yes, it is possible.
DEPLOY LIGHTNING WEB COMPONENT USING CHANGE SET IN SALESFORCE
From Setup, enter Outbound Change Sets in the Quick Find box, then select Outbound Change Sets.
In the Change Sets list, click the name of a change set, or create a new one. Click Add to add components.
Choose the type of component as Lightning Web Component Bundle and select the components you want to add, and then click Add to Change Set.
-
2Right and that is what i thought but if i click that it says There are no remaining components of the selected type available to add to your change set. Jun 9, 2021 at 3:17