From eceae1e767888ac49af8173f6c5e1c022e8f1e13 Mon Sep 17 00:00:00 2001 From: Folyd Date: Sun, 26 May 2024 16:09:45 -0700 Subject: [PATCH] Fix crates export --- rust/src/tasks/crates.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rust/src/tasks/crates.rs b/rust/src/tasks/crates.rs index 0a11a622..ca1fc988 100644 --- a/rust/src/tasks/crates.rs +++ b/rust/src/tasks/crates.rs @@ -110,7 +110,7 @@ fn generate_javascript_crates_index(crates: &[Crate], minifier: &Minifier) -> St }) .collect(); let crate_index = format!( - "const crateIndex={};export default crateIndex;", + "const crateIndex={};", serde_json::to_string(&crates_map).unwrap() ); contents.push_str(&Minifier::minify_js(&crate_index)); @@ -179,6 +179,7 @@ impl Task for CratesTask { serde_json::to_string(&mapping)? ); contents.push_str(&generate_javascript_crates_index(&crates, &minifier)); + contents.push_str("export {mapping,crateIndex};"); let path = Path::new(&self.dest_path); fs::write(path, &contents)?; println!("\nGenerate javascript crates index successful!");