LWCIntermediatemetadatadeploymenttargets
Design LWC metadata and deployment for multiple targets
Real World Scenario
Same LWC deployed to record page, app page, and Experience site requires different layouts and permissions.
Expected Answer
• targets in js-meta.xml: lightning__RecordPage, lightning__AppPage, lightningCommunity__Page
• Design attributes for layout mode configured per placement in App Builder
• @api density and formFactor awareness for mobile vs desktop
• Separate flexipage placements documenting intended configuration
• CI validates meta xml targets match integration tests context
• Unlocked package exposes components with documented target support
• Feature detect community vs internal with @salesforce/community/Id
Follow-Up Questions & Answers
Click to expand — each follow-up includes a direct, interview-ready answer
Main difference: use case and scale. targets in js-meta.xml: lightning__RecordPage, lightning__AppPage, lightningCommunity__Page. Design attributes for layout mode configured per placement in App Builder. Pick based on your integration pattern and team capability. Multi-target components need explicit mode property—do not fork component per surface unless necessary. Balance speed of delivery with maintainability.
Architect Perspective
Multi-target components need explicit mode property—do not fork component per surface unless necessary.