summaryrefslogtreecommitdiff
path: root/cli/ops
diff options
context:
space:
mode:
Diffstat (limited to 'cli/ops')
-rw-r--r--cli/ops/compiler.rs12
1 files changed, 10 insertions, 2 deletions
diff --git a/cli/ops/compiler.rs b/cli/ops/compiler.rs
index e6ed364da..baa7b4c1c 100644
--- a/cli/ops/compiler.rs
+++ b/cli/ops/compiler.rs
@@ -136,9 +136,9 @@ fn op_fetch_source_files(
}
_ => f,
};
- // Special handling of Wasm files:
+ // Special handling of WASM and JSON files:
// compile them into JS first!
- // This allows TS to do correct export types.
+ // This allows TS to do correct export types as well as bundles.
let source_code = match file.media_type {
msg::MediaType::Wasm => {
global_state
@@ -148,6 +148,14 @@ fn op_fetch_source_files(
.map_err(|e| OpError::other(e.to_string()))?
.code
}
+ msg::MediaType::Json => {
+ global_state
+ .json_compiler
+ .compile(&file)
+ .await
+ .map_err(|e| OpError::other(e.to_string()))?
+ .code
+ }
_ => String::from_utf8(file.source_code).unwrap(),
};
Ok::<_, OpError>(json!({