fix: order multiple inputs correctly #462
Open
+119
−15
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.
See the issue here: #461.
Summary of the problem
When using multiple inputs in rollup, css output from any non-first inputs that do not exist in the first input are placed at the top of the output and are ordered by resolve order, causing css output for multiple inputs to be non-deterministic.
Summary of the fix
In order to fix this problem, we need to trace all the places in which we are importing css and sort based on all those sources. I needed to expand some of the functions to allow for multiple entry paths, but was able to keep the
seen
checking to prevent multiple checks of shared files.Tests were added to demonstrate that the fix works.