summaryrefslogtreecommitdiff
path: root/cli/tools
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2023-08-17 12:14:22 -0400
committerGitHub <noreply@github.com>2023-08-17 16:14:22 +0000
commitf343391a9f97d29ad287f247c06aa370eb7cab50 (patch)
treeeeed398c9506fde5c20d3e552edd8a432bc5a2ae /cli/tools
parent6082e51094e0b5835d7c83586766cc611da2a382 (diff)
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.
Diffstat (limited to 'cli/tools')
-rw-r--r--cli/tools/vendor/test.rs12
1 files changed, 8 insertions, 4 deletions
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<JsxImportSourceConfig>,
+ maybe_jsx_import_source_config: Option<JsxImportSourceConfig>,
original_import_map: Option<ImportMap>,
) -> 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,
+ },
)
}