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

Unify docs about .mjs, .cjs, .js and .json config files #2150

Merged
merged 5 commits into from Jan 10, 2020

Conversation

nicolo-ribaudo
Copy link
Member

Docs for babel/babel#10903 and babel/babel#10783, follow up to #2106.

@netlify
Copy link

netlify bot commented Jan 6, 2020

Deploy preview for babel ready!

Built with commit 8ece6f8

https://deploy-preview-2150--babel.netlify.com

- `babel.config.cjs` and `.babelrc.cjs` allow you to define your configuration as CommonJS,
using `module.exports`.

- `babel.config.mjs` and `.babelrc.mjs` use native ECMAScript modules. They are only supported by
Copy link
Member

Choose a reason for hiding this comment

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

The "only supported..." followed by "and might work" read a bit weird. Maybe:

They are supported by Node.js 13.2+ (or older versions via the --experimental-modules flag)

@existentialism
Copy link
Member

Honestly not a fan of using babel.config.* everywhere... but I think enumerating all through all the various cases in one place is a needed improvement.

@nicolo-ribaudo
Copy link
Member Author

What do you think about always using babel.config.json (or babel.config.js) and only mention in one place that there are different file extensions?

Btw, I copied .* from the ESLint docs (https://eslint.org/docs/user-guide/configuring)

docs/configuration.md Outdated Show resolved Hide resolved
nicolo-ribaudo and others added 2 commits January 10, 2020 21:10
Co-Authored-By: Jayden Seric <me@jaydenseric.com>
@nicolo-ribaudo
Copy link
Member Author

@existentialism I changed the docs to always use the .json extension instead .* (I chose .json because it's the simpler format). The different extensions are still explained in the config-files.md page.

Copy link
Member

@existentialism existentialism left a comment

Choose a reason for hiding this comment

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

Just a few small nits!

nicolo-ribaudo and others added 2 commits January 10, 2020 22:02
Co-Authored-By: Brian Ng <bng412@gmail.com>
@nicolo-ribaudo nicolo-ribaudo merged commit bccc1e2 into babel:master Jan 10, 2020
@nicolo-ribaudo nicolo-ribaudo deleted the config-files-all-ests branch January 10, 2020 21:12
nicolo-ribaudo added a commit to nicolo-ribaudo/babel-website that referenced this pull request Jan 20, 2020
nicolo-ribaudo added a commit that referenced this pull request Jan 20, 2020
* Backport misc changes from #2150

* Remove 7.8.0 versioned_docs without updates
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants