Fix code-split alias modules and dynamic CSS imports#10
Open
flowerornament wants to merge 1 commit intoelixir-volt:masterfrom
Open
Fix code-split alias modules and dynamic CSS imports#10flowerornament wants to merge 1 commit intoelixir-volt:masterfrom
flowerornament wants to merge 1 commit intoelixir-volt:masterfrom
Conversation
This was referenced Apr 28, 2026
Closed
Author
|
This resolves my specific issue, but you may want to review for generality |
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.
Summary
Closes #9.
This fixes two production code-splitting edge cases:
_external/*; chunk output selection was matching by path suffix, so those modules could be omitted from the emitted chunk;import("./theme.css")should not survive as browser-runtime imports of CSS/data modules when Volt already owns stylesheet output.The patch keeps Volt's existing chunk-graph approach, but makes three targeted changes:
import(...)before per-chunk OXC bundling, then restore it before Volt rewrites chunk URLs;Repro
The public issue has the reduced cases and expected output: #9.
This PR adds tests for both cases:
code splitting includes alias modules outside the entry rootdynamic CSS imports become inert browser-loadable modulesValidation
mix format --check-formattedmix test test/builder_test.exs --seed 0AI disclosure
I used OpenAI Codex as a coding assistant to help reduce the repros and draft the candidate patch. I reviewed the diff and ran the validations above locally.