mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 15:04:11 -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:
parent
e5c3c21e95
commit
43d10a558b
6 changed files with 22 additions and 4 deletions
|
@ -1301,9 +1301,7 @@ impl CliOptions {
|
|||
self.maybe_lockfile.clone()
|
||||
}
|
||||
|
||||
/// Return any imports that should be brought into the scope of the module
|
||||
/// graph.
|
||||
pub fn to_maybe_imports(
|
||||
pub fn to_compiler_option_types(
|
||||
&self,
|
||||
) -> Result<Vec<deno_graph::ReferrerImports>, AnyError> {
|
||||
self.workspace.to_maybe_imports().map(|maybe_imports| {
|
||||
|
|
|
@ -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
|
||||
.module_info_cache
|
||||
.as_module_analyzer(&self.parsed_source_cache);
|
||||
|
|
|
@ -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"
|
||||
}
|
8
tests/specs/run/skips_compiler_option_types/deno.json
Normal file
8
tests/specs/run/skips_compiler_option_types/deno.json
Normal file
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"lock": false,
|
||||
"compilerOptions": {
|
||||
"types": [
|
||||
"https://localhost@4545/non-existent/@types/react@18.0.28"
|
||||
]
|
||||
}
|
||||
}
|
1
tests/specs/run/skips_compiler_option_types/main.out
Normal file
1
tests/specs/run/skips_compiler_option_types/main.out
Normal file
|
@ -0,0 +1 @@
|
|||
hi
|
1
tests/specs/run/skips_compiler_option_types/main.ts
Normal file
1
tests/specs/run/skips_compiler_option_types/main.ts
Normal file
|
@ -0,0 +1 @@
|
|||
console.log("hi");
|
Loading…
Reference in a new issue