Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: entry config should be defined as IndexMap #1765

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions crates/mako/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ mod tree_shaking;
mod umd;
mod watch;

use std::collections::{BTreeMap, HashMap};
use std::collections::HashMap;
use std::fmt;
use std::path::{Path, PathBuf};

Expand All @@ -49,6 +49,7 @@ pub use external::{
};
pub use generic_usize::GenericUsizeDefault;
pub use hmr::{deserialize_hmr, HmrConfig};
use indexmap::IndexMap;
pub use inline_css::{deserialize_inline_css, InlineCssConfig};
pub use manifest::{deserialize_manifest, ManifestConfig};
use miette::{miette, ByteOffset, Diagnostic, NamedSource, SourceOffset, SourceSpan};
Expand Down Expand Up @@ -128,7 +129,7 @@ pub enum Platform {
#[derive(Deserialize, Serialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct Config {
pub entry: BTreeMap<String, PathBuf>,
pub entry: IndexMap<String, PathBuf>,
pub output: OutputConfig,
pub resolve: ResolveConfig,
#[serde(deserialize_with = "deserialize_manifest", default)]
Expand Down
7 changes: 4 additions & 3 deletions crates/mako/src/module_graph.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use std::collections::{BTreeSet, HashMap, HashSet};
use std::collections::{HashMap, HashSet};
use std::fmt;

use fixedbitset::FixedBitSet;
use indexmap::IndexSet;
use petgraph::graph::{DefaultIx, NodeIndex};
use petgraph::prelude::{Dfs, EdgeRef};
use petgraph::stable_graph::{StableDiGraph, WalkNeighbors};
Expand All @@ -15,15 +16,15 @@ use crate::module::{Dependencies, Dependency, Module, ModuleId};
pub struct ModuleGraph {
pub id_index_map: HashMap<ModuleId, NodeIndex<DefaultIx>>,
pub graph: StableDiGraph<Module, Dependencies>,
entries: BTreeSet<ModuleId>,
entries: IndexSet<ModuleId>,
}

impl ModuleGraph {
pub fn new() -> Self {
Self {
id_index_map: HashMap::new(),
graph: StableDiGraph::new(),
entries: BTreeSet::new(),
entries: IndexSet::new(),
}
}

Expand Down
Loading