Open devongovett opened 5 years ago
Is this available? For example, if you're using Jest, is it possible to use Parcel to transform the TypeScript?
This seems important, and I'm interested as well. In the process of converting a CRA react and node backend, and got as far as trying to run my Jest tests through parcel and ended up here. I'm interested in working on this feature, although I'd need some guidance. Let me see if I can get the existing @swc/Jest + babel tooling to work as a model.
How do I tell which version of swc a given parcel version is using? I'm on 2.2.1.
I had started on it here. Haven't had time to work on it recently. Feel free to take a look if you want! https://github.com/parcel-bundler/parcel/compare/parcel-node
Without this, should there be a disclaimer that parcel doesn't support unit testing? One of the key features of parcel is the transformer pipeline, which is unsupported.
@devongovett Any movement on this from you? Thoughts on starting with getting the new transform and resolve functions you have added to Parcel?
I can see the @parcel/register
package that is available now. Curious if I am missing a jest one?
The idea here is to enable Parcel transformers and resolvers to be run in other places than just bundling via a package similar to
babel-register
or other require hooks in node. This way, you could run the same Parcel transformers that you run when bundling your app in your tests, which might run in node.Currently it is very challenging to set up a real world app, even with Parcel, because you are still stuck configuring other tools like mocha, jest, babel, and others for your tests, not even your real app. If you could get the same zero configuration experience just by loading
@parcel/require
in node, that would be pretty great.There are a bunch of Parcel features that would be great to be able to use in tests:
source
andalias
fields in package.json. No manually configuringbabel-register
to include certain node_modules. Using the Parcel resolver, this would be possible.babel-register
might not be enough if you are using other compilers. We could even automatically handle things like CSS imports that won't work in node.@parcel/register
would only run the Parcel transformer pipeline, not any packagers or actual bundling. It would operate on a per-file level, and hook into the node module system to compile and resolve modules.