amark / gun

An open source cybersecurity protocol for syncing decentralized graph data.
https://gun.eco/docs
Other
17.93k stars 1.16k forks source link

Setup without build tools #1363

Open zzph opened 5 months ago

zzph commented 5 months ago

Hi there,

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

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 !

amark commented 5 months ago

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!