Skip to content

Commit

Permalink
fix: minify module filter use absolute path (#1259)
Browse files Browse the repository at this point in the history
  • Loading branch information
shulandmimi committed Apr 28, 2024
1 parent 6a9b13c commit 6129421
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/moody-goats-confess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@farmfe/core': patch
---

minify module filter use absolute path
5 changes: 3 additions & 2 deletions crates/plugin_runtime/src/render_resource_pot/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@ pub fn resource_pot_to_runtime_object(

let minify_enabled =
matches!(minify_options.mode, MinifyMode::Module) && context.config.minify.enabled();
let is_enabled_minify =
|module_id: &ModuleId| minify_enabled && path_filter.execute(module_id.relative_path());
let is_enabled_minify = |module_id: &ModuleId| {
minify_enabled && path_filter.execute(&module_id.resolved_path(&context.config.root))
};

resource_pot
.modules()
Expand Down

0 comments on commit 6129421

Please sign in to comment.