diff --git a/crates/mako/src/module.rs b/crates/mako/src/module.rs index e23aa9b2c..353774559 100644 --- a/crates/mako/src/module.rs +++ b/crates/mako/src/module.rs @@ -282,7 +282,9 @@ impl PartialOrd for ModuleId { impl ModuleId { // we use absolute path as module id now pub fn new(id: String) -> Self { - Self { id } + Self { + id: win_path(id.as_str()), + } } pub fn generate(&self, context: &Arc) -> String { @@ -304,20 +306,22 @@ impl ModuleId { impl From for ModuleId { fn from(id: String) -> Self { - Self { id } + Self { + id: win_path(id.as_str()), + } } } impl From<&str> for ModuleId { fn from(id: &str) -> Self { - Self { id: id.to_string() } + Self { id: win_path(id) } } } impl From for ModuleId { fn from(path: PathBuf) -> Self { Self { - id: path.to_string_lossy().to_string(), + id: win_path(path.to_string_lossy().to_string().as_str()), } } }