From f343391a9f97d29ad287f247c06aa370eb7cab50 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Thu, 17 Aug 2023 12:14:22 -0400 Subject: fix(unstable): disable importing from the vendor directory (#20067) Some people might get think they need to import from this directory, which could cause confusion and duplicate dependencies. Additionally, the `vendor` directory has special behaviour in the language server, so importing from the folder will definitely cause confusion and issues there. --- cli/tools/vendor/test.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'cli/tools') diff --git a/cli/tools/vendor/test.rs b/cli/tools/vendor/test.rs index 0bf6f84f3..c00cc654d 100644 --- a/cli/tools/vendor/test.rs +++ b/cli/tools/vendor/test.rs @@ -26,6 +26,7 @@ use crate::cache::ParsedSourceCache; use crate::npm::CliNpmRegistryApi; use crate::npm::NpmResolution; use crate::resolver::CliGraphResolver; +use crate::resolver::CliGraphResolverOptions; use super::build::VendorEnvironment; @@ -290,7 +291,7 @@ impl VendorTestBuilder { } fn build_resolver( - jsx_import_source_config: Option, + maybe_jsx_import_source_config: Option, original_import_map: Option, ) -> CliGraphResolver { let npm_registry_api = Arc::new(CliNpmRegistryApi::new_uninitialized()); @@ -300,13 +301,16 @@ fn build_resolver( None, )); CliGraphResolver::new( - jsx_import_source_config, - original_import_map.map(Arc::new), - false, npm_registry_api, npm_resolution, Default::default(), Default::default(), + CliGraphResolverOptions { + maybe_jsx_import_source_config, + maybe_import_map: original_import_map.map(Arc::new), + maybe_vendor_dir: None, + no_npm: false, + }, ) } -- cgit v1.2.3