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
esm support #44
Comments
Could you please create a small repo or gist to describe your use case fully? I'm still learning Vite. Note that this module has a dependency, reusify, so I guess we would do the same there as well? How would that work? |
Yes will do! When you bundle the code for esm distribution, it will rewrite the dependencies, and their dependencies, and so on, all the way down the stack, so you just need to tell it what the entrypoint is, and it'll do the rest, which means reusify will be fine. |
Depending on how much you want to jump on the ESM train there are at least a few ways to handle this:
|
Converting to ESM only is not viable. I think the only viable path is bundling and providing a module entry point. |
I use this module in a number of client-side libraries, and with Svelte-Kit, which uses Vite under the hood.
Because Vite/Svelte-Kit are esm-first, configuration needs to be added to any apps which use my libraries.
How would you feel about a PR to add a small (5-7 line or so) rollup config which would build an esm-compatible version of this library and export it as the
module
attribute frompackage.json
?Or, alternative solutions welcome.
The text was updated successfully, but these errors were encountered: