From 21aa954d1c747b6e556c42eacb5a17478245dd17 Mon Sep 17 00:00:00 2001 From: Nicolas Lepage <19571875+nlepage@users.noreply.github.com> Date: Mon, 2 Dec 2019 17:04:06 +0100 Subject: [PATCH] :alembic: --- docs/sw.js | 1 + index.js | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) create mode 100644 docs/sw.js diff --git a/docs/sw.js b/docs/sw.js new file mode 100644 index 0000000..eef3c08 --- /dev/null +++ b/docs/sw.js @@ -0,0 +1 @@ +importScripts('https://cdn.jsdelivr.net/gh/nlepage/go-wasm-http-server@b4be701615d284296a4a1aaa852db02f139969ee/index.js') diff --git a/index.js b/index.js index b8ba0f5..c2464fa 100644 --- a/index.js +++ b/index.js @@ -1,7 +1,5 @@ -const swUrl = 'https://cdn.jsdelivr.net/gh/nlepage/go-wasm-http-server@b4be701615d284296a4a1aaa852db02f139969ee/index.js' - window.wasmhttp = { - register: async (wasm, { scope, base = '' } = {}) => { + register: async (wasm, { scope, base = '', swUrl = 'sw.js' } = {}) => { const options = {} if (scope) options.scope = scope //FIXME register once