-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[deno-app-build] Ensure wasm dependency is cached offline
- Loading branch information
Showing
4 changed files
with
32 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { | ||
transpile as originalTranspile, | ||
type TranspileOptions, | ||
} from "jsr:@deno/[email protected]"; | ||
export { type TranspileOptions }; | ||
|
||
export async function transpile( | ||
root: string | URL, | ||
options: TranspileOptions = {}, | ||
) { | ||
const DENO_EMIT_WASM_CACHE_HOME = Deno.env.get("DENO_EMIT_WASM_CACHE_HOME"); | ||
|
||
if (!DENO_EMIT_WASM_CACHE_HOME) { | ||
throw new Error("DENO_EMIT_WASM_CACHE_HOME env var is not set"); | ||
} | ||
|
||
Deno.env.set("HOME", DENO_EMIT_WASM_CACHE_HOME); | ||
Deno.env.set("XDG_DATA_HOME", DENO_EMIT_WASM_CACHE_HOME); | ||
return await originalTranspile(root, options); | ||
} |