Repository navigation
Conversation
| js += `\nimport "${id}?html-proxy&index=${inlineModuleIndex}.js"` | ||
| // include a content hash in the proxy id so that editing the | ||
| // inline script is detected as a change by the bundler | ||
| js += `\nimport "${id}?html-proxy&index=${inlineModuleIndex}&h=${getHash(contents)}.js"` |
There was a problem hiding this comment.
I feel like the right fix for that is, instead of adding a hash here, on the Rolldown side. A changed file should invalidate every module whose id contains the same file. For example, in vue, foo.vue?vue&type=script and foo.vue?vue&type=template should both has file dependencies of foo.vue. A change to foo.vue will invalidate these modules with queries all together. This is the same counterpart as webpack's fileDependencies and Vite unbundled-dev's fileToModulesMap.
There was a problem hiding this comment.
Yes, agreed — the &h= hash is a workaround, not a root fix. Do you plan to fix this scenario on the rolldown side, or is it already supported/fixed there?
There was a problem hiding this comment.
It looks fine for a workaround 👍. I haven't fixed this. Let me handle this in Rolldown since it might be also related to #22956.
Co-authored-by: andrew <andywangsy@gmail.com>
fix #23179
Editing an inline script in an html entry was invisible to the dev engine, so no reload happened and even a manual reload served stale content until the server was restarted.
For classic inline scripts the updated html itself only reaches the dev output once rolldown includes re-emitted assets with changed content in rebuild output (rolldown/rolldown#10637). The e2e test for that case is skipped under bundledDev until the fix is released.