speedskater / babel-plugin-rewire

A babel plugin adding the ability to rewire module dependencies. This enables to mock modules for testing purposes.
843 stars 90 forks source link

Simply including this breaks lots of things #222

Closed erquhart closed 1 month ago

erquhart commented 5 years ago

I love the things rewire can do, but I can't figure out why it's colliding with a number of other libraries.

Here's CI output from introducing Rewire to Netlify CMS - even if I exclude the added test file and just add the plugin, breaks happen across the codebase: https://app.netlify.com/sites/cms-demo/deploys/5c09367d02ed83051f6bfd69

You can see in the output that failures happen in emotion, which indicates it can't find its plugin (changing plugin order so emotion is last doesn't help), but also in relation to a number of lodash functions and a few other CJS imports.

The project uses Babel 7, config here: https://github.com/netlify/netlify-cms/blob/tests-cloudinary/babel.config.js

Any thoughts?