From d4a971a3ad2770b012710dac911d043df55fbbc2 Mon Sep 17 00:00:00 2001 From: Alexander Kehr Date: Thu, 13 Aug 2020 17:18:38 +0200 Subject: [PATCH 1/2] ts declaration file name for wasm import --- crates/cli-support/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/cli-support/src/lib.rs b/crates/cli-support/src/lib.rs index dd05e9ea23a..bb2b4e2f3e5 100755 --- a/crates/cli-support/src/lib.rs +++ b/crates/cli-support/src/lib.rs @@ -702,7 +702,7 @@ impl Output { } if gen.typescript { - let ts_path = wasm_path.with_extension("d.ts"); + let ts_path = wasm_path.with_extension("wasm.d.ts"); let ts = wasm2es6js::typescript(&self.module)?; fs::write(&ts_path, ts) .with_context(|| format!("failed to write `{}`", ts_path.display()))?; From 97b6f4b5d235473590d8cac94b5c98c889c30832 Mon Sep 17 00:00:00 2001 From: Alexander Kehr Date: Thu, 13 Aug 2020 17:57:17 +0200 Subject: [PATCH 2/2] fix typescript-tests --- crates/typescript-tests/src/memory.ts | 2 +- crates/typescript-tests/src/simple_fn.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/typescript-tests/src/memory.ts b/crates/typescript-tests/src/memory.ts index b1095b006a6..4c7e44c7d3a 100644 --- a/crates/typescript-tests/src/memory.ts +++ b/crates/typescript-tests/src/memory.ts @@ -1,3 +1,3 @@ -import * as wasm from '../pkg/typescript_tests_bg'; +import * as wasm from '../pkg/typescript_tests_bg.wasm'; const memory: WebAssembly.Memory = wasm.memory; diff --git a/crates/typescript-tests/src/simple_fn.ts b/crates/typescript-tests/src/simple_fn.ts index 62eba44370a..b25a31431f2 100644 --- a/crates/typescript-tests/src/simple_fn.ts +++ b/crates/typescript-tests/src/simple_fn.ts @@ -1,5 +1,5 @@ import * as wbg from '../pkg/typescript_tests'; -import * as wasm from '../pkg/typescript_tests_bg'; +import * as wasm from '../pkg/typescript_tests_bg.wasm'; const wbg_greet: (a: string) => void = wbg.greet; const wasm_greet: (a: number, b: number) => void = wasm.greet;