Add support for .cjs config files#10599
Merged
nicolo-ribaudo merged 4 commits intobabel:masterfrom Nov 3, 2019
Merged
Conversation
JLHwung
reviewed
Oct 24, 2019
| const cwd = await fs.promises.mkdtemp(os.tmpdir() + path.sep + name); | ||
| const tmp = name => path.join(cwd, name); | ||
| const config = name => | ||
| fs.promises.copyFile(fixture("config-files-templates", name), tmp(name)); |
Contributor
There was a problem hiding this comment.
fs.promises is not supported until 10.x
JLHwung
approved these changes
Oct 24, 2019
Member
Author
|
Docs added to babel/website#2106 |
cc8aa30 to
85728a3
Compare
85728a3 to
d69f9ce
Compare
yordis
reviewed
Nov 3, 2019
| const ROOT_CONFIG_FILENAMES = [ | ||
| BABEL_CONFIG_JS_FILENAME, | ||
| BABEL_CONFIG_JSON_FILENAME, | ||
| "babel.config.js", |
Contributor
There was a problem hiding this comment.
What about .mjs? Would that be an issue in the future?
Member
Author
There was a problem hiding this comment.
We don't support configurations which must be loaded asynchronously (like es modules) yet.
xtuc
approved these changes
Nov 3, 2019
Member
Author
|
@fisker In our tests there isn't that warning 🤔 |
Contributor
|
@fisker |
This was referenced Nov 23, 2019
This was referenced Nov 28, 2019
This was referenced Dec 5, 2019
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The three commits should be reviewed one by one:
babel.config.cjsand.babelrc.jstest.each(since we are testing the same things for each config file)I'm marking this PR as
High Prioritybecause we need it to support using Babel in packages using"type": "module"in their package.json. Note that while ES modules are still experimental in Node 13.0.0, they will be enabled by default in 13.1.0 (https://twitter.com/jasnell/status/1184265267951493120).