Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions site/src/_includes/components/usage.njk
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down