Skip to content

Add support for babel.config.json#10501

Merged
nicolo-ribaudo merged 3 commits intobabel:masterfrom
devongovett:babel-config-json
Oct 29, 2019
Merged

Add support for babel.config.json#10501
nicolo-ribaudo merged 3 commits intobabel:masterfrom
devongovett:babel-config-json

Conversation

@devongovett
Copy link
Copy Markdown
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
Copy Markdown
Member

We should throw if both are used in the same folder

@devongovett
Copy link
Copy Markdown
Contributor Author

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

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown

@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
Copy Markdown
Member

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

@devongovett
Copy link
Copy Markdown
Contributor Author

@nicolo-ribaudo
Copy link
Copy Markdown
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