v147 · html · covered on mdn
JSON and style support for link rel=modulepreload
<link rel="modulepreload"> can now preload JSON modules (as="json") and CSS modules (as="style") in addition to JavaScript modules. This allows pages to declaratively preload all their module graph dependencies — including non-JS modules — so they are parsed and stored in the module map before they are needed.
this feature is documented on MDN
MDN: rel="modulepreload"
MDN's modulepreload reference covers all supported as values including "json" and "style", with usage examples and browser compatibility. gendn doesn't duplicate that here.
quick reference
New as values | as="json" — preload a JSON module; as="style" — preload a CSS module |
|---|---|
| Usage | <link rel="modulepreload" as="json" href="/data/config.json"> |
| Effect | JSON/CSS module is fetched, parsed, and inserted into the module map so import … assert {type: 'json'} or import … assert {type: 'css'} hits the cache |
| Shipped in | Chrome 147 (desktop + Android) |
| ChromeStatus | 5202661416763392 — JSON and style support for link rel=modulepreload |
| Spec | HTML Living Standard — modulepreload |