Repository navigation
Support json/style as modulepreload destinations #10233
Description
Activity
Presumably they're already supported if they're deeper in the module graph. Just not as a top-level entry. I guess it makes sense to reuse the
asattribute here?cc @domenic @whatwg/modules
Presumably they're already supported if they're deeper in the module graph.
Right, in cases where modulepreload starts fetching the graph.
Just not as a top-level entry. I guess it makes sense to reuse the
asattribute here?Yes exactly, extend as to be script-like + json/style
cc @domenic @whatwg/modules
@nicolo-ribaudo WDYT?
This is a good change -- it should be possible to use
modulepreloadto load all the components of an ESM graph.Currently
modulepreloadis a subset ofpreload, however there is no use case forpreload as=jsonso it makes sense to only support JSON inmodulepreload.Reacted by Noam RosenthalThis is a good change -- it should be possible to use
modulepreloadto load all the components of an ESM graph.Currently
modulepreloadis a subset ofpreload, however there is no use case forpreload as=jsonso it makes sense to only support JSON inmodulepreload.It's sort-of a subset, it also populates the module map and uses
crossoriginby default.Yeah sorry, I meant "the possible resource types you can load with modulepreload are a subset of those you can load with preload".
Reacted by Noam Rosenthal- addedagenda+To be discussed at a triage meetingTo be discussed at a triage meeting
on Dec 2, 2025 - addedagenda+To be discussed at a triage meetingTo be discussed at a triage meetingand removedagenda+To be discussed at a triage meetingTo be discussed at a triage meeting
on Dec 4, 2025 - added a commit that references this issue
on Jan 31, 2026 - added a commit that references this issue
on Mar 31, 2026
What is the issue with the HTML Standard?
json/css modules are available in
import, however themodulepreloadspec only allows script-like destinations (see https://html.spec.whatwg.org/multipage/links.html#link-type-modulepreload:link-type-modulepreload-3).Allowing json/style here would allow preloading them for the purpose of imports.