Skip to content

Commit

Permalink
Invalidate entry point on change in dev server (#2153)
Browse files Browse the repository at this point in the history
* Fix entry point invalidation on change

* Changesets
  • Loading branch information
frandiox committed May 28, 2024
1 parent c31c655 commit cd888ec
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/purple-carrots-melt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/mini-oxygen': patch
---

Update server in development when entry point (`<root>/server.js`) changes.
3 changes: 2 additions & 1 deletion packages/mini-oxygen/src/vite/worker-entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ function fetchEntryModule(publicUrl: URL, env: ViteEnv) {
// module to avoid hanging promises in workerd
for (const update of data.updates) {
runtime.moduleCache.invalidateDepTree([
update.path,
// Module IDs are absolute from root
update.path.replace(/^\.\//, '/'),
...(update.ssrInvalidates ?? []),
]);
}
Expand Down

0 comments on commit cd888ec

Please sign in to comment.