You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: load CSS when using server-side route resolution (#13498)
When implementing server-side route resolution we didn't think of the CSS associated with the entry points of the pages. Since Vite isn't involved in that chain, it can't automatically wire up the imports correctly, so we gotta add code to load them ourselves.
Fixes#13491
Copy file name to clipboardExpand all lines: packages/kit/src/runtime/client/utils.js
+37Lines changed: 37 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -331,3 +331,40 @@ export function is_external_url(url, base, hash_routing) {
331
331
332
332
returnfalse;
333
333
}
334
+
335
+
/** @type {Record<string, boolean>} */
336
+
constseen={};
337
+
338
+
/**
339
+
* Used for server-side resolution, to replicate Vite's CSS loading behaviour in production.
340
+
*
341
+
* Closely modelled after https://github.com/vitejs/vite/blob/3dd12f4724130fdf8ba44c6d3252ebdff407fd47/packages/vite/src/node/plugins/importAnalysisBuild.ts#L214
342
+
* (which ideally we could just use directly, but it's not exported)
0 commit comments