gun
gun copied to clipboard
Setup without build tools
Hi there,
I’m trying to integrate using this within a Chrome Extension as part of a service worker.
- From this repo, create a
minifiedbuild of the latest version of gun.js - Put that minified file into my project, then import it in my service worker as ‘var gun = importScripts(“./gun.js”)’
I get the welcome message (“Hello wonderful person...”), but I cannot use the library as "gun" is undefined.
Without build tools, what's the correct way to import/use this library?
Ps brilliant work on this @amark !
I believe @bmatusiak has a fix for this in github master, not in npm yet, but you can manually shim meanwhile if you want for serviceworkers by doing window = self before import I think. Sorry!
THanks!