is there an event of vite:preloadError?
#17720
|
The documentation says that you need to keep the I have assembled an application for production and I don't see any code there that would generate this event here is the vite code from production that handles preloading : (function () {
const o = document.createElement('link').relList;
if (o && o.supports && o.supports('modulepreload')) return;
for (const e of document.querySelectorAll('link[rel="modulepreload"]')) c(e);
new MutationObserver((e) => {
for (const r of e)
if (r.type === 'childList')
for (const n of r.addedNodes)
n.tagName === 'LINK' && n.rel === 'modulepreload' && c(n);
}).observe(document, { childList: !0, subtree: !0 });
function i(e) {
const r = {};
return (
e.integrity && (r.integrity = e.integrity),
e.referrerPolicy && (r.referrerPolicy = e.referrerPolicy),
e.crossOrigin === 'use-credentials'
? (r.credentials = 'include')
: e.crossOrigin === 'anonymous'
? (r.credentials = 'omit')
: (r.credentials = 'same-origin'),
r
);
}
function c(e) {
if (e.ep) return;
e.ep = !0;
const r = i(e);
fetch(e.href, r);
}
})(); |
Answered by
rschristian
Jul 19, 2024
Replies: 3 comments 4 replies
|
That's the |
4 replies
0 replies
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Your HTML isn't relevant.
Vite's preloader is used to automatically preload additional chunks, usually from code splitting (dynamic imports) or CSS imports, to avoid waterfalls. If you're not making use of that, however, the preloader isn't needed.