Skip to content
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

[FEATURE]: Publish to CDN #550

Open
chaffeqa opened this issue May 31, 2024 · 2 comments
Open

[FEATURE]: Publish to CDN #550

chaffeqa opened this issue May 31, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@chaffeqa
Copy link

We have a project we would love to use this library for, but it would not be run via npm. Would be great to be able to have an module version (and maybe umd) to be able to import.

Happy to contribute it! Just want to make sure you are open before making a PR

@chaffeqa chaffeqa changed the title [FEATURE]: publish to CDN [FEATURE]: Publish to CDN May 31, 2024
@raymond-lam raymond-lam added the enhancement New feature or request label May 31, 2024
@raymond-lam
Copy link
Collaborator

@chaffeqa If you run npm run build for this project, it will build an index.mjs file in the dist directory (along with an .d.mts file) -- would this meet your needs?

@chaffeqa
Copy link
Author

Unfortunately no, I figured that out, but I have a few issues still:

  1. It requires me to have an npm project. We have a rails website with a single page we want to load the builder into. The best solution is to load js scripts from a cdn.
  2. Mjs versions require all other libs to be mjs, which not all are as of right now. Even react suggests loading the umd version via browser.

Right now I'm working around this by running a roll-up locally to build the umd version from the node_modules. It's a pretty involved step that I wouldn't expect most devs to know how to do. Took me a few hours to stumble through and is an extra build step

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants