1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-24 15:19:26 -05:00

fix: do not download compilerOptions -> types when not type checking (#24473)

Closes https://github.com/denoland/deno/issues/22738
This commit is contained in:
David Sherret 2024-07-09 17:07:16 -04:00 committed by GitHub
parent e5c3c21e95
commit 43d10a558b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 22 additions and 4 deletions

View file

@ -1301,9 +1301,7 @@ impl CliOptions {
self.maybe_lockfile.clone() self.maybe_lockfile.clone()
} }
/// Return any imports that should be brought into the scope of the module pub fn to_compiler_option_types(
/// graph.
pub fn to_maybe_imports(
&self, &self,
) -> Result<Vec<deno_graph::ReferrerImports>, AnyError> { ) -> Result<Vec<deno_graph::ReferrerImports>, AnyError> {
self.workspace.to_maybe_imports().map(|maybe_imports| { self.workspace.to_maybe_imports().map(|maybe_imports| {

View file

@ -481,7 +481,11 @@ impl ModuleGraphBuilder {
} }
} }
let maybe_imports = self.options.to_maybe_imports()?; let maybe_imports = if options.graph_kind.include_types() {
self.options.to_compiler_option_types()?
} else {
Vec::new()
};
let analyzer = self let analyzer = self
.module_info_cache .module_info_cache
.as_module_analyzer(&self.parsed_source_cache); .as_module_analyzer(&self.parsed_source_cache);

View file

@ -0,0 +1,6 @@
{
// this was previously downloading the "types" from the compilerOptions
// even for deno run with no type checking
"args": "run main.ts",
"output": "main.out"
}

View file

@ -0,0 +1,8 @@
{
"lock": false,
"compilerOptions": {
"types": [
"https://localhost@4545/non-existent/@types/react@18.0.28"
]
}
}

View file

@ -0,0 +1 @@
hi

View file

@ -0,0 +1 @@
console.log("hi");