| name | sf-lightning |
| description | Lightning component and application development commands including generation and local preview. |
sf lightning Development
Commands for Lightning components.
sf lightning generate component
Create Lightning component.
sf lightning generate component --name myComponent \
--type lwc \
--output-dir force-app/main/default/lwc
sf lightning generate component --name myAuraComponent \
--type aura \
--output-dir force-app/main/default/aura
sf lightning generate app / event / interface
Create other Lightning artifacts.
sf lightning generate app --name MyApp \
--output-dir force-app/main/default/applications
sf lightning generate event --name MyEvent \
--output-dir force-app/main/default/aura
sf lightning generate interface --name MyInterface \
--output-dir force-app/main/default/aura
Lightning Experience Local Dev (New in 2.128.5)
Preview components and sites locally in real-time. These commands are now JIT (Just-in-Time) installed.
sf lightning dev app
Preview a Lightning Experience app locally and in real-time.
sf lightning dev app --name MyApp --target-org myOrg
sf lightning dev app --name MyApp --device-type android --target-org myOrg
sf lightning dev component
Preview LWC components in isolation.
sf lightning dev component --name myComponent --target-org myOrg
sf lightning dev site
Preview an Experience Builder site locally.
sf lightning dev site --name "Customer Portal" --target-org myOrg
[!TIP]
These commands automatically install the plugin-lightning-dev if it's not present.
Flags
| Flag | Description |
|---|
--name | Name of the app, component, or site to preview |
--device-type | Device type: desktop (default), ios, android |
-o, --target-org | Target org alias or username |
--device-id | ID of mobile device (for ios or android) |