When bundling a service worker with Webpack, the target needs to be set to webworker
. Otherwise Webpack will transform the import.meta.url
line from wasm-bindgen
into document.location.href
, which will break in a service worker context.
From the root of this repository,
Build the @dfinity/response-verification
package:
./scripts/package.sh
Link @dfinity/response-verification
globally:
pushd ./pkg && sudo npm link && popd
Change into this project's directory:
cd examples/service-worker
Install NPM modules:
npm install
Link @dfinity/response-verification
in this project:
npm link @dfinity/response-verification
Run:
npm start
Bundle application:
npm run build
Run:
npm run start:http