From d1b689c2fb7e62b9772b7ef43d5639c9e1ba0554 Mon Sep 17 00:00:00 2001 From: Sankalp Thakur Date: Tue, 28 Jul 2026 14:26:26 +0530 Subject: [PATCH] docs: document quicklink.modern.mjs bundle (#385) --- README.md | 6 ++++++ site/src/_includes/components/usage.njk | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/README.md b/README.md index 7705f8a4..bb733e92 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,12 @@ ES Module import: import {listen, prefetch} from 'quicklink'; ``` +Modern ES Module (`quicklink.modern.mjs`) — a smaller build for browsers with native ES module support (no legacy transforms). Prefer this when you only need to support modern browsers: + +```js +import {listen, prefetch} from 'quicklink/dist/quicklink.modern.mjs'; +``` + ## Single page apps (React) ### Installation diff --git a/site/src/_includes/components/usage.njk b/site/src/_includes/components/usage.njk index 4514b9b1..c3cf8088 100644 --- a/site/src/_includes/components/usage.njk +++ b/site/src/_includes/components/usage.njk @@ -29,6 +29,12 @@ import {listen} from 'quicklink/dist/quicklink.mjs'; listen(); {% endhighlight %} +{{ "Modern ES Module (`quicklink.modern.mjs`) — a smaller build for browsers with native ES module support (no legacy transforms). Prefer this when you only need to support modern browsers:" | markdown | safe }} +{% highlight "js" %} +import {listen} from 'quicklink/dist/quicklink.modern.mjs'; +listen(); +{% endhighlight %} + {{ "The above options are best for multi-page sites. Single-page apps have a few options available for using quicklink with a router:" | markdown | safe }} {{ "* Call `quicklink.listen()` once a navigation to a new route has completed" | markdown | safe }} {{ "* Call `quicklink.listen()` against a specific DOM element / component" | markdown | safe }}