fix: respect entryFileNames directory for bootstrap file output#786
Merged
gioboa merged 2 commits intoJun 7, 2026
Merged
Conversation
Contributor
Author
commit: |
cb6e989 to
9907029
Compare
Contributor
Author
|
@gioboa please re-approve workflow run |
gioboa
reviewed
Jun 7, 2026
gioboa
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for your help @pcfreak30
I have two small comments:
- With base: "/app/", the bootstrap file is emitted under static/js/, but the generated host init import is rebased to ../app/static/js/hostInit-abc.js. From static/js/, this resolves incorrectly; it should import the sibling file as ./hostInit-abc.js.
- Absolute URLs should not be rebased. When renderBuiltUrl or similar returns https://..., rebaseImport() currently treats it like a local bare path and rewrites it to ../https://..., producing an invalid import URL.
gioboa
requested changes
Jun 7, 2026
The MF bootstrap file was emitted with a hardcoded fileName (mf-entry-bootstrap-N.js) at the build root, bypassing Rollup's entryFileNames pattern. When users configure entryFileNames to place JS in a subdirectory (e.g. static/js/), the bootstrap file still landed at the root while all other entries went to static/js/. Derive the directory prefix from the emitted hostInit file path at build time (since Vite/Rolldown normalizes entryFileNames before plugins can read it). Rebase the import paths inside the bootstrap to be relative to its new location instead of the HTML root, preventing doubled paths like static/js/static/js/. Falls back to root-level output when no subdirectory is detected for backward compatibility.
58b89df to
ca8db0e
Compare
Contributor
Author
|
@gioboa done |
Contributor
Author
|
@gioboa if you still see issues, let me know how to re-prod as an example so I can troubleshoot. |
gioboa
approved these changes
Jun 7, 2026
gioboa
left a comment
Collaborator
There was a problem hiding this comment.
That's amazing thanks @pcfreak30 👏
This was referenced Jun 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

The MF bootstrap file was emitted with a hardcoded fileName (mf-entry-bootstrap-N.js) at the build root, bypassing Rollup's entryFileNames pattern. When users configure entryFileNames to place JS in a subdirectory (e.g. static/js/), the bootstrap file still landed at the root while all other entries went to static/js/.
Derive the directory prefix from the emitted hostInit file path at build time (since Vite/Rolldown normalizes entryFileNames before plugins can read it). Rebase the import paths inside the bootstrap to be relative to its new location instead of the HTML root, preventing doubled paths like static/js/static/js/.
Falls back to root-level output when no subdirectory is detected for backward compatibility.
The new bootstrap concept broke how I use MF, and so this adds back the needed flexibility for my use case.