gun icon indicating copy to clipboard operation
gun copied to clipboard

Setup without build tools

Open zzph opened this issue 1 year ago • 1 comments

Hi there,

I’m trying to integrate using this within a Chrome Extension as part of a service worker.

  • From this repo, create a minified build 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 !

zzph avatar Jan 31 '24 10:01 zzph

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!

amark avatar Feb 04 '24 09:02 amark