Add proper bundling to tsc

This commit is contained in:
Jonathan Kelley committed 2024-02-27 16:33:18 -08:00
1 parent bdacca0dfb
commit 4b64894fc5
15 files changed
+267 -1065

No files matched your search

+2 -2
View File
@@ -23,7 +23,7 @@ fn main() {
fn gen_bindings(name: &str) {
let contents = read_to_string(&format!("src/{name}.ts")).unwrap();
let generated = read_to_string(&format!("src/gen/{name}.js")).unwrap_or_default();
let hashed = hash_file(&contents);
let hashed = hash_it(&contents);
// If the file is generated, and the hash is the same, we're good, don't do anything
if generated
@@ -58,7 +58,7 @@ fn gen_bindings(name: &str) {
std::fs::write(&format!("src/gen/{name}.js"), generated).unwrap();
}
fn hash_file(obj: &str) -> u64 {
fn hash_it(obj: impl Hash) -> u64 {
let mut hasher = DefaultHasher::new();
obj.hash(&mut hasher);
hasher.finish()