Skip to content

Allow 'babelrc' and 'babelrcRoots' in config files (but not .babelrc/extends)#7911

Merged
loganfsmyth merged 4 commits into
babel:masterfrom
loganfsmyth:config-babelrcroots
May 14, 2018
Merged

Allow 'babelrc' and 'babelrcRoots' in config files (but not .babelrc/extends)#7911
loganfsmyth merged 4 commits into
babel:masterfrom
loganfsmyth:config-babelrcroots

Conversation

@loganfsmyth

@loganfsmyth loganfsmyth commented May 12, 2018

Copy link
Copy Markdown
Member
Q                       A
Fixed Issues? Fixes #7874, Fixes #7922
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR
Any Dependency Changes?
License MIT

This allows babel.config.js files to define babelrcRoots so that users don't have to specify that option in multiple places if they don't want to.

Also properly sets configFile: false when a partial config is loaded, so we don't double-process the config.

@loganfsmyth loganfsmyth added PR: Bug Fix 🐛 A type of pull request used for our changelog categories PR: New Feature 🚀 A type of pull request used for our changelog categories labels May 12, 2018
@loganfsmyth loganfsmyth added this to the Babel 7 RC milestone May 12, 2018
@babel-bot

babel-bot commented May 12, 2018

Copy link
Copy Markdown
Collaborator

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) {

@nicolo-ribaudo nicolo-ribaudo May 12, 2018

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should merge them, if they are specified in both places?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then we should at least warn instead of silently ignoring some values.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, maybe. I worry that it would be annoying if the user was specifically trying to override the value.

@loganfsmyth
loganfsmyth merged commit dca2631 into babel:master May 14, 2018
@loganfsmyth
loganfsmyth deleted the config-babelrcroots branch May 14, 2018 17:41
@hzoo hzoo mentioned this pull request Jun 15, 2018
5 tasks
@lock lock Bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Oct 5, 2019
@lock lock Bot locked as resolved and limited conversation to collaborators Oct 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Bug Fix 🐛 A type of pull request used for our changelog categories PR: New Feature 🚀 A type of pull request used for our changelog categories

Projects

None yet

4 participants