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

Breaks ES Modules #3

Open
jwarkentin opened this issue Jan 26, 2022 · 1 comment
Open

Breaks ES Modules #3

jwarkentin opened this issue Jan 26, 2022 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@jwarkentin
Copy link

When transpiling to ES Modules (including setting "type": "module" in package.json) this breaks Jest tests with the error:

ReferenceError: module is not defined

It seems it doesn't take the targeted build type into account and just assumes it's building CommonJS modules. I know the options are limited and I'm not certain what the best solution is, but since ES Module adoption is only increasing it would be nice to have the option to not produce a broken build with Jest. Just wanted to at least raise the issue for consideration.

@Xunnamius
Copy link
Owner

Xunnamius commented Jan 26, 2022

Thanks for this! ESM has different rules (like module and exports not being available) but there may be a solution. I'll take a look.

@Xunnamius Xunnamius added the enhancement New feature or request label Jan 26, 2022
@Xunnamius Xunnamius added the help wanted Extra attention is needed label Jun 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants