Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for babel.config.json #10501

Merged
merged 3 commits into from Oct 29, 2019

Conversation

devongovett
Copy link
Contributor

Implements support for babel.config.json in addition to the existing babel.config.js. This allows root configuration to be static JSON, which has many benefits including better cacheability, easier linting, better autocomplete, and better upgrade tools. See #10495 for more details.

Q                       A
Fixed Issues? Closes #10495
Patch: Bug Fix? No
Major: Breaking Change? No
Minor: New Feature? Yes
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes? No
License MIT

@nicolo-ribaudo
Copy link
Member

We should throw if both are used in the same folder

@devongovett
Copy link
Contributor Author

Good idea @nicolo-ribaudo! Refactored to match how findRelativeConfig did this.

Copy link
Member

@nicolo-ribaudo nicolo-ribaudo left a comment

Choose a reason for hiding this comment

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

From a code point of view, this PR looks good 👍

Let's see what others (especially @loganfsmyth who implemented config resolution in Babel 7) think about this.

Copy link
Member

@loganfsmyth loganfsmyth left a comment

Choose a reason for hiding this comment

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

No complaints from me.

@nicolo-ribaudo nicolo-ribaudo added this to the v7.7.0 milestone Sep 27, 2019
@nicolo-ribaudo nicolo-ribaudo added the PR: Ready to be Merged A pull request with already two approvals, but waiting for the next minor release label Sep 27, 2019
Copy link

@hg-pyun hg-pyun left a comment

Choose a reason for hiding this comment

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

LGTM

@nicolo-ribaudo
Copy link
Member

@devongovett Could you add this new config file to https://github.com/babel/website/blob/master/docs/config-files.md?

@devongovett
Copy link
Contributor Author

@nicolo-ribaudo
Copy link
Member

(Rebased)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: config outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: core PR: New Feature 🚀 A type of pull request used for our changelog categories PR: Ready to be Merged A pull request with already two approvals, but waiting for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RFC: Support babel.config.json for better cacheability
5 participants