diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2020-05-20 16:25:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-20 16:25:40 +0200 |
commit | 8799855fdc97960b18fbbb3450ed132e352607c4 (patch) | |
tree | f9539f9c0acbbed88d789d64980f0ebd546229e8 /cli/module_graph.rs | |
parent | f366e5e9bb5982376b160bebd35c3edf2c9ff19b (diff) |
refactor: reorganize TS compiler (#5603)
Diffstat (limited to 'cli/module_graph.rs')
-rw-r--r-- | cli/module_graph.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cli/module_graph.rs b/cli/module_graph.rs index 23a9fe26b..21e575cfd 100644 --- a/cli/module_graph.rs +++ b/cli/module_graph.rs @@ -1,5 +1,6 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. +use crate::file_fetcher::map_file_extension; use crate::file_fetcher::SourceFile; use crate::file_fetcher::SourceFileFetcher; use crate::import_map::ImportMap; @@ -19,6 +20,7 @@ use serde::Serialize; use serde::Serializer; use std::collections::HashMap; use std::hash::BuildHasher; +use std::path::PathBuf; use std::pin::Pin; fn serialize_module_specifier<S>( @@ -258,9 +260,9 @@ impl ModuleGraphLoader { ModuleGraphFile { specifier: specifier.to_string(), url: specifier.to_string(), + media_type: map_file_extension(&PathBuf::from(specifier.clone())) + as i32, filename: specifier, - // ignored, it's set in TS worker - media_type: MediaType::JavaScript as i32, source_code, imports, referenced_files, |