sw-wasm-host.mjs raw

   1  // sw-wasm-host.mjs - written by `moxie build -target wasm`.
   2  //
   3  // The page-side half of a Moxie wasm bundle. The module runs in a Worker
   4  // (channel receives block in Atomics.wait, which the page thread forbids)
   5  // and the page answers its DOM calls through $runtime/relay.mjs, so a page
   6  // only has to import this file and start it:
   7  //
   8  //   import { start } from './sw-wasm-host.mjs';
   9  //   await start();
  10  
  11  import { load } from './$runtime/loader.mjs';
  12  
  13  export const wasm = new URL('./sw.wasm', import.meta.url).href;
  14  
  15  export function start() { return load(wasm); }
  16  
  17  export default start;
  18