The Wayback Machine - https://web.archive.org/web/20200528064353/https://github.com/developit/microbundle/issues/554
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 a Jest Transform #554

Open
therealparmesh opened this issue Jan 29, 2020 · 4 comments
Open

Provide a Jest Transform #554

therealparmesh opened this issue Jan 29, 2020 · 4 comments

Comments

@therealparmesh
Copy link

@therealparmesh therealparmesh commented Jan 29, 2020

It may be convenient to expose something to consumers that will make it easier to use Jest - something like the default babel options (presets, plugins, etc.) or a transform module (see something like https://github.com/ActuallyACat/jest-esm-transformer).

This makes using syntax like import/export much easier for folks who use this amazing library for bundling and Jest for tests.

Thank you!

@developit
Copy link
Owner

@developit developit commented Jan 29, 2020

@therealparmesh great suggestion. I see that Jest can already do this when Babel is installed, though because Microbundle abstract Babel Jest likely doesn't detect it. So I guess you're saying it would be nice if there was a Microbundle-provided option here?

If so, I agree!

@developit developit changed the title Jest transform Provide a Jest Transform Jan 29, 2020
@therealparmesh
Copy link
Author

@therealparmesh therealparmesh commented Jan 29, 2020

Precisely what I meant!

FWIW, my current workaround is to have my Jest tests import from dist (You can see it here: https://github.com/therealparmesh/object-to-formdata/blob/b0c0be74a3e510ea8be2efa56f85e4e21ba3afa7/src/index.test.js#L1). This works well - even with features like code coverage (because of the source maps that point to the src).

@therealparmesh
Copy link
Author

@therealparmesh therealparmesh commented Feb 7, 2020

Any feedback on this? 😄

@hbroer
Copy link

@hbroer hbroer commented Apr 10, 2020

microbundle could save the configuration to the project root with a "This is autogenerated. Don't change it."

If microbundle would come with a "public" Babel config, it would also be possible to put a eslint config to the root with just a extend property.

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

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.
Morty Proxy This is a proxified and sanitized view of the page, visit original site.