Skip to content

Commit

Permalink
fix: Convert local import to be dynamic
Browse files Browse the repository at this point in the history
Signed-off-by: Gordon Smith <[email protected]>
  • Loading branch information
GordonSmith committed Jan 12, 2023
1 parent 6fd8498 commit af11237
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion hw-base91.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<div id="placeholder"></div>
<script type="module">
// Prefer local version (if available) ---
import { Base91 as Base91Local } from "./dist/index.js";
const Base91Local = await import("./dist/index.js").then(m => m.Base91).catch(() => undefined);
import { Base91 as Base91External } from "https://cdn.jsdelivr.net/npm/@hpcc-js/wasm/dist/index.js";

const Base91 = Base91Local ?? Base91External;
Expand Down
2 changes: 1 addition & 1 deletion hw-graphviz.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<div id="placeholder"></div>
<script type="module">
// Prefer local version (if available) ---
import { Graphviz as GraphvizLocal } from "./dist/index.js";
const GraphvizLocal = await import("./dist/index.js").then(m => m.Graphviz).catch(() => undefined);
import { Graphviz as GraphvizExternal } from "https://cdn.jsdelivr.net/npm/@hpcc-js/wasm/dist/index.js";

const Graphviz = GraphvizLocal ?? GraphvizExternal;
Expand Down
2 changes: 1 addition & 1 deletion hw-zstd.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<div id="placeholder"></div>
<script type="module">
// Prefer local version (if available) ---
import { Zstd as ZstdLocal } from "./dist/index.js";
const ZstdLocal = await import("./dist/index.js").then(m => m.Zstd).catch(() => undefined);
import { Zstd as ZstdExternal } from "https://cdn.jsdelivr.net/npm/@hpcc-js/wasm/dist/index.js";

const Zstd = ZstdLocal ?? ZstdExternal;
Expand Down

0 comments on commit af11237

Please sign in to comment.