diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2024-04-16 16:46:31 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-16 16:46:31 -0400 |
commit | 43c8c1cc6e0f0fe4accde97c52f7f2bb998ac669 (patch) | |
tree | 157e9e3801253b1ad9345aded73e684a39292bc5 /cli/graph_util.rs | |
parent | 422cff1f247dc334d5eb9387be924f5937b0c6d9 (diff) |
feat(check): allow using side effect imports with unknown module kinds (ex. css modules) (#23392)
This allows people to use imports like:
```ts
import "./app.css";
```
...with `deno check` in systems where there's a bundle step (ex. Vite).
This will still error when using it with `deno run` or if the referenced
file does not exist.
See test cases for behaviour.
Diffstat (limited to 'cli/graph_util.rs')
-rw-r--r-- | cli/graph_util.rs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/cli/graph_util.rs b/cli/graph_util.rs index 6214a1628..f3b69b243 100644 --- a/cli/graph_util.rs +++ b/cli/graph_util.rs @@ -110,13 +110,23 @@ pub fn graph_valid( } } + if graph.graph_kind() == GraphKind::TypesOnly + && matches!( + error, + ModuleGraphError::ModuleError(ModuleError::UnsupportedMediaType(..)) + ) + { + log::debug!("Ignoring: {}", message); + return None; + } + if options.is_vendoring { // warn about failing dynamic imports when vendoring, but don't fail completely if matches!( error, ModuleGraphError::ModuleError(ModuleError::MissingDynamic(_, _)) ) { - log::warn!("Ignoring: {:#}", message); + log::warn!("Ignoring: {}", message); return None; } |