Skip to content

Commit

Permalink
fix: stable generated exports (#313)
Browse files Browse the repository at this point in the history
  • Loading branch information
hyf0 authored Nov 17, 2023
1 parent c7749ba commit 526a04b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions crates/rolldown/src/bundler/chunk/render_chunk_exports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,15 @@ impl Chunk {
fn get_export_items(&self, graph: &LinkStageOutput) -> Vec<(Atom, SymbolRef)> {
self.entry_module.map_or_else(
|| {
self
let mut tmp = self
.exports_to_other_chunks
.iter()
.map(|(export_ref, alias)| (alias.clone(), *export_ref))
.collect::<Vec<_>>()
.collect::<Vec<_>>();

tmp.sort_unstable_by(|a, b| a.0.as_str().cmp(b.0.as_str()));

tmp
},
|entry_module_id| {
let linking_info = &graph.linking_infos[entry_module_id];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var init_a = __esm({
foo
}
});
export { init_a, foo, a_ns };
export { a_ns, foo, init_a };
```
## a.mjs

Expand Down

0 comments on commit 526a04b

Please sign in to comment.