Skip to content

Commit

Permalink
add inline prop option, defaults to false
Browse files Browse the repository at this point in the history
so that the Worker code can be inlined as base64 when desired
  • Loading branch information
DougAnderson444 committed Jun 13, 2024
1 parent 01680d8 commit aa2dcdc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/lib/components/loader/WurboLoader.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
import { $init as init, provider } from './graph/graph.js';
import Progress from './Progress.svelte';
/**
* Whether the worker should be loaded inline as base64 or not.
* Default is false.
*/
export let inline = false;
let pluginFile;
const files = new Map();
Expand Down Expand Up @@ -91,7 +97,7 @@
});
// load the import handles into the Wasm component and get the ES module returned
wurbo = new Wurbo({ arrayBuffer, importables }, async (payload) => {
wurbo = new Wurbo({ arrayBuffer, importables, inline }, async (payload) => {
// Relay emitted commands from the Wasm component to PiperNet
console.log('Command emitted: ', { payload });
try {
Expand Down

0 comments on commit aa2dcdc

Please sign in to comment.