Skip to content

Commit

Permalink
fix: use the proper url to walk through modules during dev style coll…
Browse files Browse the repository at this point in the history
…ection

This also undoes the changes made by 3d79eb6
because the size of `staticImportedUrls` doesn't actually tell if the url is
dynamically imported by its parent. We need a different way to detect
dynamically imported modules.
  • Loading branch information
katywings committed Jun 19, 2024
1 parent a63eabd commit 308d489
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/lazy-glasses-hope.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"vinxi": patch
---

Fixed a bug in the dev style collection that resulted in flashes of unstyled content.
4 changes: 1 addition & 3 deletions packages/vinxi/lib/manifest/collect-styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,7 @@ async function findDeps(vite, node, deps, ssr) {
// }
} else if (!ssr) {
for (const { url } of node.importedModules) {
if (node.staticImportedUrls?.size) {
await add_by_url(node.url, ssr);
}
await add_by_url(url, ssr);
}
}
}
Expand Down

0 comments on commit 308d489

Please sign in to comment.