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

generate bundled, one file, esm build, too #817

Closed
wants to merge 1 commit into from

Conversation

doits
Copy link

@doits doits commented Jan 25, 2023

I'm not sure if this is the right way, but my problem is the following: I'm using https://github.com/rails/importmap-rails to vendor js files by downloading them. It only downloads the file https://ga.jspm.io/npm:[email protected]/esm/index.js which references other modules though, which are not downloaded and then 404. importmap-rails expects one file to contain everything, see for example rails/importmap-rails#65 and rails/importmap-rails#153.

I just amended the rollup config to create such a bundled esm file. It seems to work by my manual tests, so maybe you could see if everything is correct and generate this file when publishing the package?

In addition it would be nice to know if https://github.com/rails/importmap-rails can be made to automatically use it then (I assume it uses the module: entrypoint by default; is there maybe an entrypoint definition for "one module containing them all"?), but first I'd like to make sure the bundled esm is generated correctly and there's a chance for it to be included when imask is built.

WDYT?

@uNmAnNeR uNmAnNeR closed this Jun 15, 2023
@fastjames
Copy link

@doits I ran into the same issue today, so it was nice to see your PR for some validation of my experience.

I'm testing a workaround now where I modified the relevant line in the importmap to

pin "imask", to: "https://cdn.jsdelivr.net/npm/[email protected]/dist/imask.min.js"

That at least resolves the 404s but I have not confirmed that it works. If you didn't find a workaround already, I hope this helps you in your quest.

@doits
Copy link
Author

doits commented Oct 5, 2024

Unfortunately it doesn't work. I'm still in need for a imask.esm.js (and imask.esm.min.js). Basically a compiled ESM-version to distribute. Any chance to add it @uNmAnNeR?

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

Successfully merging this pull request may close these issues.

3 participants