diff options
author | Kevin (Kun) "Kassimo" Qian <kevinkassimo@gmail.com> | 2019-04-01 18:46:40 -0700 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2019-04-01 21:46:40 -0400 |
commit | 534b8d30219a605c82bac706bc5429d44ae53c32 (patch) | |
tree | 2e653b1590fc237030d56f8535fa40d2dd923262 /cli/compiler.rs | |
parent | e44084c90dec8cafbc66d4e485ff24479c56ec2e (diff) |
Follow redirect location as new referrers for nested module imports (#2031)
Fixes #1742
Fixes #2021
Diffstat (limited to 'cli/compiler.rs')
-rw-r--r-- | cli/compiler.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/cli/compiler.rs b/cli/compiler.rs index bd0a763c1..6816df2ee 100644 --- a/cli/compiler.rs +++ b/cli/compiler.rs @@ -104,6 +104,7 @@ impl WorkerBehavior for CompilerBehavior { #[derive(Debug, Clone)] pub struct ModuleMetaData { pub module_name: String, + pub module_redirect_source_name: Option<String>, // source of redirect pub filename: String, pub media_type: msg::MediaType, pub source_code: Vec<u8>, @@ -250,6 +251,9 @@ pub fn compile_sync( ) { Ok(serde_json::Value::Object(map)) => ModuleMetaData { module_name: module_meta_data_.module_name.clone(), + module_redirect_source_name: module_meta_data_ + .module_redirect_source_name + .clone(), filename: module_meta_data_.filename.clone(), media_type: module_meta_data_.media_type, source_code: module_meta_data_.source_code.clone(), @@ -342,6 +346,7 @@ mod tests { let mut out = ModuleMetaData { module_name: "xxx".to_owned(), + module_redirect_source_name: None, filename: "/tests/002_hello.ts".to_owned(), media_type: msg::MediaType::TypeScript, source_code: include_bytes!("../tests/002_hello.ts").to_vec(), |