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

Provide ESM bundle #185

Open
marvin-j97 opened this issue Jul 14, 2023 · 5 comments
Open

Provide ESM bundle #185

marvin-j97 opened this issue Jul 14, 2023 · 5 comments

Comments

@marvin-j97
Copy link

Most popular packages have moved on to ESM-only or dual export packages.
Moo is still using the old-fashioned UMD format, being not-really-compatible with modern tooling.

@tjvr
Copy link
Collaborator

tjvr commented Sep 27, 2023

Hi, can you give an example of tooling that is not compatible with Moo today?

@nathan
Copy link
Collaborator

nathan commented Sep 28, 2023

I imagine "not-really-compatible" here means "it works completely fine and my packaging script can't exclude compileStates" or "it works completely fine and my editor can't autocomplete the entry point names"

@mb21
Copy link

mb21 commented Feb 1, 2024

Yeah, without ESM bundle it cannot be tree-shaken... but looking at the source, I'm not sure how much there could be shaken away anyway..?

@johndeighan
Copy link

ESM would allow this, which is a style I use all the time:

import {compile} from 'moo';

@weotch
Copy link

weotch commented Nov 13, 2024

Hi, can you give an example of tooling that is not compatible with Moo today?

I brought it into a Remix app via gqlmin and I am getting the following error:

TypeError: Cannot read properties of undefined (reading 'states')
    at Module.minify [as default] (/node_modules/gqlmin/dist/index.js:4:21)

When I add moo to the optimizeDeps of Vite, this issue goes away.

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

No branches or pull requests

6 participants