trunk-rs/trunk

Feature request: preload option for copy-file assets

Open

#787 opened on May 1, 2024

 (1 comment) (2 reactions) (0 assignees)Rust (315 forks)auto 404
enhancementhelp wanted

Repository metrics

Stars
 (4,347 stars)
PR merge metrics
 (PR metrics pending)

Description

Hello,

It would be nice to have a shortcut to also preload a copied file.

Instead of this:

<link data-trunk rel="copy-file" href="assets/ui/button.svg" />
<link rel="preload" as="image" href="button.svg" />

Just write something like that:

<link data-trunk data-preload="image" rel="copy-file" href="assets/ui/button.svg" />

Contributor guide