Reland "fix(cli): don't store blob and data urls in the module cache" (#18581)

Relands #18261 now that
https://github.com/lucacasonato/esbuild_deno_loader/pull/54 is landed
and used by fresh.
Fixes #18260.
This commit is contained in:
Nayeem Rahman 2023-07-01 23:52:30 +01:00 committed by GitHub
parent 4e2f02639e
commit b9c0e7cd55
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 142 additions and 184 deletions

View file

@ -69,7 +69,10 @@ impl CacheMetadata {
&self,
specifier: &ModuleSpecifier,
) -> Option<Arc<HashMap<MetadataKey, String>>> {
if matches!(specifier.scheme(), "file" | "npm" | "node") {
if matches!(
specifier.scheme(),
"file" | "npm" | "node" | "data" | "blob"
) {
return None;
}
let version = self
@ -85,7 +88,10 @@ impl CacheMetadata {
}
fn refresh(&self, specifier: &ModuleSpecifier) -> Option<Metadata> {
if matches!(specifier.scheme(), "file" | "npm" | "node") {
if matches!(
specifier.scheme(),
"file" | "npm" | "node" | "data" | "blob"
) {
return None;
}
let cache_filename = self.cache.get_cache_filename(specifier)?;