aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/ts-worker.ts
blob: 460885c56e85f00a97dadd6b75ed32d1923a6aa9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
export default (async () => {
  const contents = new TextDecoder().decode(
    (await (await import('brotli-wasm')).default).decompress(
      await fetch('./generated/ts-worker.js.br')
        .then((v) => v.arrayBuffer())
        .then((v) => new Uint8Array(v))
    )
  );
  const worker = new Worker(`data:text/javascript;base64,${btoa(contents)}`);
  return worker;
})();