Skip to content

Commit

Permalink
fix: alias priority
Browse files Browse the repository at this point in the history
  • Loading branch information
SyMind committed Dec 27, 2024
1 parent 15b07b6 commit 25669cf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/rspack_core/src/normal_module_factory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,8 @@ impl NormalModuleFactory {

fn calculate_resolve_options(&self, module_rules: &[&ModuleRuleEffect]) -> Option<Arc<Resolve>> {
let mut resolved: Option<Resolve> = None;
for rule in module_rules {
// TODO: 为了 alias 的优先级临时修改,之后修改
for rule in module_rules.iter().rev() {
if let Some(rule_resolve) = &rule.resolve {
if let Some(r) = resolved {
resolved = Some(r.merge(rule_resolve.to_owned()));
Expand Down

0 comments on commit 25669cf

Please sign in to comment.