mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 12:19:12 +00:00
fix(compile): handle TypeScript file included as asset (#27032)
Closes #27024
This commit is contained in:
parent
d04d5677d9
commit
4365f8d999
7 changed files with 158 additions and 27 deletions
|
@ -87,6 +87,7 @@ use super::serialization::RemoteModulesStore;
|
|||
use super::serialization::RemoteModulesStoreBuilder;
|
||||
use super::virtual_fs::FileBackedVfs;
|
||||
use super::virtual_fs::VfsBuilder;
|
||||
use super::virtual_fs::VfsFileSubDataKind;
|
||||
use super::virtual_fs::VfsRoot;
|
||||
use super::virtual_fs::VirtualDirectory;
|
||||
|
||||
|
@ -275,7 +276,9 @@ impl StandaloneModules {
|
|||
if specifier.scheme() == "file" {
|
||||
let path = deno_path_util::url_to_file_path(specifier)?;
|
||||
let bytes = match self.vfs.file_entry(&path) {
|
||||
Ok(entry) => self.vfs.read_file_all(entry)?,
|
||||
Ok(entry) => self
|
||||
.vfs
|
||||
.read_file_all(entry, VfsFileSubDataKind::ModuleGraph)?,
|
||||
Err(err) if err.kind() == ErrorKind::NotFound => {
|
||||
let bytes = match RealFs.read_file_sync(&path, None) {
|
||||
Ok(bytes) => bytes,
|
||||
|
@ -691,6 +694,7 @@ impl<'a> DenoCompileBinaryWriter<'a> {
|
|||
Some(source) => source,
|
||||
None => RealFs.read_file_sync(&file_path, None)?,
|
||||
},
|
||||
VfsFileSubDataKind::ModuleGraph,
|
||||
)
|
||||
.with_context(|| {
|
||||
format!("Failed adding '{}'", file_path.display())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue