mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 20:29:11 +00:00
fix(compile): do not error including npm packages that don't match current system (#30188)
Part of https://github.com/denoland/deno/issues/30177
This commit is contained in:
parent
3a5ba56801
commit
4850b3ba91
1 changed files with 12 additions and 1 deletions
|
@ -867,11 +867,22 @@ impl<'a> DenoCompileBinaryWriter<'a> {
|
|||
.resolution()
|
||||
.all_system_packages(&self.npm_system_info);
|
||||
packages.sort_by(|a, b| a.id.cmp(&b.id)); // determinism
|
||||
let current_system = NpmSystemInfo::default();
|
||||
for package in packages {
|
||||
let folder =
|
||||
npm_resolver.resolve_pkg_folder_from_pkg_id(&package.id)?;
|
||||
if !package.system.matches_system(¤t_system)
|
||||
&& !folder.exists()
|
||||
{
|
||||
log::warn!(
|
||||
"{} Ignoring 'npm:{}' because it was not present on the current system.",
|
||||
crate::colors::yellow("Warning"),
|
||||
package.id
|
||||
);
|
||||
} else {
|
||||
builder.add_dir_recursive(&folder)?;
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue