Allow 'babelrc' and 'babelrcRoots' in config files (but not .babelrc/extends)#7911
Conversation
…al config and then pass it back to Babel.
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/7912/ |
| if (babelrc === undefined) { | ||
| babelrc = validatedFile.options.babelrc; | ||
| } | ||
| if (babelrcRoots === undefined) { |
There was a problem hiding this comment.
Maybe we should merge them, if they are specified in both places?
There was a problem hiding this comment.
I'm always hesitant to do merging for anything that isn't key/value pairs, because it's not as clear what the user expects. I'd rather not encourage people to specify this in two places, anyway.
There was a problem hiding this comment.
Then we should at least warn instead of silently ignoring some values.
There was a problem hiding this comment.
Hmm, maybe. I worry that it would be annoying if the user was specifically trying to override the value.
This allows
babel.config.jsfiles to definebabelrcRootsso that users don't have to specify that option in multiple places if they don't want to.Also properly sets
configFile: falsewhen a partial config is loaded, so we don't double-process the config.