fbjs icon indicating copy to clipboard operation
fbjs copied to clipboard

_moduleMap Babel option as require path

Open nickdima opened this issue 8 years ago • 3 comments

If you need to pull fbjs/module-map as _moduleMap in .babelrc there's no way to do it aside from copy/pasting everything as you can't require from there. Would it be feasible to detect if the option is a string and in that case do a require on it?

nickdima avatar Oct 20 '15 21:10 nickdima

It's possible but for the most part we've avoided using babelrc (as using the API directly has given more flexibility). What use case are you trying to solve?

zpao avatar Oct 20 '15 21:10 zpao

I was connecting the dots for React's build process and considering using a .babelrc and this seemed like the only blocking issue. Anyway, just exploring options...

nickdima avatar Oct 20 '15 21:10 nickdima

We have a config that varies slightly when running tests (don't need all the transforms, for example the DEV one… though we're running it) so I've generally shied away from the rc and towards a shared base config that can be extended (though we don't actually do that in React at the moment).

I'm not against changing how things work, just want to make sure it's worth it and that it's something we can do across our projects.

zpao avatar Oct 20 '15 21:10 zpao