You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
why the setting of targets.node='current' for test env only?
Users may not be running the current release of node. Some temperamental libraries don't yet support new things in current since it's the bleeding edge.
Is this necessary: modules: 'commonjs'
I think so for the following reasons:
If not set, I think it defaults to ES modules from webpack (or so I have read). These are not supported in all versions of nodejs (which jest uses to run).
Depending on the version, you need to additionally include the --experimental-modules flag
Regarding the example babel config files:
Is this necessary:
https://github.com/rails/webpacker/blob/master/lib/install/examples/react/babel.config.js#L26
and why the setting of
targets.node='current'
for test env only?This is definitely related: #416
But I think it's not necessary with newer versions of babel, jest, node, etc.
And simpler is better, generally.
I think just adding this plugin for the test env would do the trick:
The text was updated successfully, but these errors were encountered: