mirror of
https://github.com/denoland/deno.git
synced 2024-11-24 15:19:26 -05:00
feat: Don't warn about --allow-script when using esbuild (#25894)
`esbuild` can work fine without needing to run post-install script, so to make it easier on users (especially people using Vite) we are not prompting to run with `--allow-scripts` again. We only do that for version >= 0.18.0 to be sure.
This commit is contained in:
parent
7cccb7422b
commit
eff64238b6
1 changed files with 12 additions and 0 deletions
|
@ -4,6 +4,7 @@ use super::bin_entries::BinEntries;
|
|||
use crate::args::LifecycleScriptsConfig;
|
||||
use deno_npm::resolution::NpmResolutionSnapshot;
|
||||
use deno_semver::package::PackageNv;
|
||||
use deno_semver::Version;
|
||||
use std::borrow::Cow;
|
||||
use std::rc::Rc;
|
||||
|
||||
|
@ -113,6 +114,17 @@ impl<'a> LifecycleScripts<'a> {
|
|||
} else if !self.strategy.has_run(package)
|
||||
&& (self.config.explicit_install || !self.strategy.has_warned(package))
|
||||
{
|
||||
// Skip adding `esbuild` as it is known that it can work properly without lifecycle script
|
||||
// being run, and it's also very popular - any project using Vite would raise warnings.
|
||||
{
|
||||
let nv = &package.id.nv;
|
||||
if nv.name == "esbuild"
|
||||
&& nv.version >= Version::parse_standard("0.18.0").unwrap()
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
self
|
||||
.packages_with_scripts_not_run
|
||||
.push((package, package_path.into_owned()));
|
||||
|
|
Loading…
Reference in a new issue