Skip to content

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

crates/rolldown/src/utils/render_chunks.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use rolldown_common::{
88
};
99
use rolldown_plugin::{HookRenderChunkArgs, SharedPluginDriver};
1010
use rolldown_sourcemap::{SourceMap, collapse_sourcemaps};
11-
use rustc_hash::FxHashMap;
11+
use rolldown_utils::indexmap::FxIndexMap;
1212

1313
use crate::type_alias::IndexInstantiatedChunks;
1414

@@ -28,7 +28,7 @@ pub async fn render_chunks(
2828
None
2929
}
3030
})
31-
.collect::<FxHashMap<ArcStr, Arc<RollupRenderedChunk>>>(),
31+
.collect::<FxIndexMap<ArcStr, Arc<RollupRenderedChunk>>>(),
3232
);
3333

3434
let result = try_join_all(assets.iter_mut().enumerate().map(|(index, asset)| {

crates/rolldown_binding/src/options/plugin/types/binding_render_chunk_meta_chunks.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
1-
use std::{collections::HashMap, sync::Arc};
1+
use std::sync::Arc;
22

33
use arcstr::ArcStr;
4+
use indexmap::IndexMap;
45
use rolldown_common::RollupRenderedChunk;
5-
use rustc_hash::FxHashMap;
6+
use rolldown_utils::indexmap::FxIndexMap;
7+
use rustc_hash::FxBuildHasher;
68

79
use crate::types::binding_rendered_chunk::BindingRenderedChunk;
810

911
#[napi_derive::napi]
1012
#[derive(Debug)]
1113
pub struct BindingRenderedChunkMeta {
12-
inner: Arc<FxHashMap<ArcStr, Arc<RollupRenderedChunk>>>,
14+
inner: Arc<FxIndexMap<ArcStr, Arc<RollupRenderedChunk>>>,
1315
}
1416

1517
#[napi_derive::napi]
1618
impl BindingRenderedChunkMeta {
17-
pub fn new(inner: Arc<FxHashMap<ArcStr, Arc<RollupRenderedChunk>>>) -> Self {
19+
pub fn new(inner: Arc<FxIndexMap<ArcStr, Arc<RollupRenderedChunk>>>) -> Self {
1820
Self { inner }
1921
}
2022

2123
#[napi(getter)]
22-
pub fn chunks(&self) -> HashMap<String, BindingRenderedChunk> {
24+
pub fn chunks(&self) -> IndexMap<String, BindingRenderedChunk, FxBuildHasher> {
2325
self
2426
.inner
2527
.iter()

crates/rolldown_plugin/src/types/hook_render_chunk_args.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ use std::sync::Arc;
22

33
use arcstr::ArcStr;
44
use rolldown_common::{RollupRenderedChunk, SharedNormalizedBundlerOptions};
5-
use rustc_hash::FxHashMap;
5+
use rolldown_utils::indexmap::FxIndexMap;
66

77
#[derive(Debug)]
88
pub struct HookRenderChunkArgs<'a> {
99
pub options: &'a SharedNormalizedBundlerOptions,
1010
pub code: String,
1111
pub chunk: Arc<RollupRenderedChunk>,
12-
pub chunks: Arc<FxHashMap<ArcStr, Arc<RollupRenderedChunk>>>,
12+
pub chunks: Arc<FxIndexMap<ArcStr, Arc<RollupRenderedChunk>>>,
1313
}

0 commit comments

Comments
 (0)