Skip to content

Latest commit

 

History

History
60 lines (39 loc) · 931 Bytes

File metadata and controls

60 lines (39 loc) · 931 Bytes

Service Worker Example Project

Gotchas

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.

Setup

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 with Webpack Dev Server

Run:

npm start

Run with HTTP Server

Bundle application:

npm run build

Run:

npm run start:http