Closed jkoskela closed 5 years ago
Awesome! This is exactly what I was looking for, and it works perfectly in my project :-)
We've got a new PR up at https://github.com/FormidableLabs/babel-plugin-transform-define/pull/57 for full babel7 support with a different approach for dynamic configurations of leaving it to babel7 .babelrc.js
and babel.config.js
loading and execution semantics (environment vars, etc.).
This is a different approach than extending the bespoke configuration file search semantics, but hopefully the power of real JS, env vars, etc. in babel7 allows all use cases to be met?
Closing in favor of #57
I was having problems using this plugin with react-native. The issue is that the react-native packager (metro) runs in a subdirectory of node_modules. However, my tests run from the root directory of my package. So they need different paths for the config file passed to transform-define.
This searches recursively for the config file specified as an argument to the plugin. It follows pattern from .babelrc node_modules, etc.