feat(repl): support npm packages (#16770)

Co-authored-by: David Sherret <dsherret@gmail.com>
This commit is contained in:
Bartek Iwańczuk 2022-12-13 13:53:32 +01:00 committed by GitHub
parent 5d9bb8b4b0
commit 435948e470
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 201 additions and 10 deletions

View file

@ -699,10 +699,10 @@ fn get_document_path(
cache: &HttpCache,
specifier: &ModuleSpecifier,
) -> Option<PathBuf> {
if specifier.scheme() == "file" {
specifier_to_file_path(specifier).ok()
} else {
cache.get_cache_filename(specifier)
match specifier.scheme() {
"npm" | "node" => None,
"file" => specifier_to_file_path(specifier).ok(),
_ => cache.get_cache_filename(specifier),
}
}