-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
Permit direct module import? #7
Comments
Hey @Rosuav! Don't know if this is still an issue or something you're needing, but if so, @instafluff added some details in the README on using the jsdelivr.net CDN. So to use it in the manner you mentioned, you'd just need to use |
OH! Thank you so much @hugodahl I forgot about this open issue! |
Ah, cool. Thanks. It still can't be directly imported into the local namespace due to compatibility difficulties across the multiple use-cases, but I can at least remove it from my repo. Would be awesome if it could actually be imported directly, but that would probably break compatibility with non-module usage. At very best, it would require non-module users to say "<script type=module>" for Comfy, even if they don't do that for their own modules. |
Does GitHub pages do something special to enable modules or does something like this work through the CDN? import ComfyJS from "https://cdn.jsdelivr.net/npm/comfy.js/dist/comfy"; |
No, it would mean a small change to the code, I think, but I'm not 100% sure how to do it in a way that wouldn't break other usage. The easiest and cleanest way is to disallow non-module use, which means that anyone using it in a script tag needs to say In order to make that export line work, there needs to be an export named "default". |
Currently, ComfyJS is available either by copying it to your own project, or using NPM. If this repo had GitHub Pages active, it could also be available as:
or equivalently:
I'm okay with copying an MIT-licensed file into my own project from a licensing perspective, but it means that any project using this is going to be frozen in time, upgrading only when it's explicitly redownloaded.
The text was updated successfully, but these errors were encountered: