-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setup without build tools #1363
Comments
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 THanks! |
importScripts(“./gun.js”)’ only imports script into context, doesn't return anything , sometimes except for the last declared variable in the scripts global scope.. quite possible that globalThis.GUN or globalThis.Gun or gloabl.GUN or gloabl.Gun exist Require and importScript are both functions used to include modules in JavaScript files: RequirePart of the CommonJS module system, require is used in Node.js for server-side development. It can be called from anywhere in the program, and it returns an object. Require is dynamic, meaning it loads modules during runtime, so it can be used conditionally. For example, you can use require inside conditions or functions. ImportScriptPart of web workers, importScript loads additional code, but it pauses execution of the worker to fetch and evaluate each script. It executes scripts in the global scope, similar to a <script> tag, so variables in one script can overwrite others. |
closing this for now.. please re-open if your still having issues |
Hi there,
I’m trying to integrate using this within a Chrome Extension as part of a service worker.
minified
build of the latest version of gun.jsI 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 !
The text was updated successfully, but these errors were encountered: