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

ESM export #292

Open
christian-bromann opened this issue Jan 25, 2023 · 1 comment
Open

ESM export #292

christian-bromann opened this issue Jan 25, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@christian-bromann
Copy link

Describe the bug A clear and concise description of what the bug is.

This is less a bug as a feature request. It would be great if this package could export an ESM bundle. I am maintaining the WebdriverIO project and we are recommending this library for component testing in the browser. We have Vite transforming the CJS code into ESM but it fails doing that for Windows for whatever reasons.

I thought exporting an ESM version is a reasonable request and would make adopters life a bit easier.

Happy to take a stab at it.

To Reproduce Steps to reproduce the behavior:

Try to import this package within a ESM context.

Expected behavior

It should load.

Screenshots

Related information:

  • @testing-library/vue version:
  • Vue version:
  • node version:
  • npm (or yarn) version:

Relevant code or config (if any)

Additional context

@christian-bromann christian-bromann added the bug Something isn't working label Jan 25, 2023
@afontcu afontcu added enhancement New feature or request and removed bug Something isn't working labels Jan 26, 2023
@sheremet-va
Copy link

On the Vitest side, we are very interested in having this implemented. Importing @testing-library/vue in Vite incorrectly imports UMD build of @vue/test-utils because it uses the browser condition and bypasses the import one - not sure if it's the bug in Vite or it's supposed to prioritise require condition if require() was used (like in this package).

I will try to prepare a PR when I have more time.

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

3 participants