Dynamically Import ESM Modules From A CDN

Lazy load JavaScript code from a content delivery network to serve users only what they need when they need it.

David Dal Busco
ITNEXT
Published in
7 min readSep 27, 2021

--

Photo by Daniel Born on Unsplash

What if I told you modern browsers can natively import a single, or sets of functions, of a JavaScript library bundles, at runtime and, from a CDN? Wouldn’t that open up possibilities?

--

--