Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

ES6 Import Maps

Public visualization

Viewing a saved revision (read-only)

143e9ee378df48da9362530b310ec5c4

ES6 Import Maps

0 stars0🌍 Public
CCurran Kelleher
Last edited Oct 26, 2021
Created on Oct 26, 2021
Forked from HTML Starter

This example demonstrates how a web page can display large text entirely through an ES module import map, rendering the phrase "Import Maps" in the browser. Using a vanilla HTML structure, it defines an import map that aliases the package name `d3-selection` to a remote URL, then imports the `select` function from that package. The code applies the selection to the body element and sets its text content, showcasing the ability to use external libraries without a module bundler or build step.

AI-generated description

An example of import maps.

This is exciting because it allows us to write ES modules that import from packages using only vanilla HTML, no module bundler.