Salesforce Lightning Web Components — Include External JavaScript
How to include external JavaScript into Salesforce LWC
This series will give a full & beginner-friendly overview of Salesforce Lightning Web Components (LWC). You can follow along with this Guide for free and use the shown examples in your own Salesforce Trail System.
This series contains the following stories. You can go through all of them or just start here with the fourth story: we are going to use external JavaScript in our Salesforce LWC with a cool Leaflet.JS example.
- Salesforce & Salesforce Lightning Web Components Basics & Preconditions
- Salesforce Lightning Web Components — Your first LWC
- Salesforce Lightning Web Components — Interacting with Salesforce Data
- Salesforce Lightning Web Components — Include External Javascripts → This article
In this story, we will build the below-displayed Lightning Web Component in Salesforce using Leaflet.JS as an external JavaScript library. It will show the location of an Account as a marker on a Leaflet map.