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
Do not bail on SHOW_CONFIG_FOR matches #12954
Conversation
@@ -125,3 +124,4 @@ programmatic options from @babel/cli | |||
}, | |||
"filename": "./src/index.js" | |||
} | |||
"use strict"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should print a separator between the code and the config? Something like
================================================================================
As an alternative, maybe it would be better to print the config on stderr so that it doesn't breaks things such as
cat input.js | babel --config-file ./babel.config.json > output.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the debug output should be directed to stderr
.
For example curl -v http://example.com/example.avif > example.avif
will also break, unless we specify -O example.avif
. Similary in this case, consider use --out-file example.js
instead.
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/44385/ |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 46b622e:
|
@@ -11,7 +11,6 @@ module.exports = { | |||
"@foo/babel-preset-1", | |||
[ | |||
{ | |||
name: "@foo/inline-babel-preset-1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q: What is this change needed for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Babel will throw name
is not a valid option. I didn't know name
is forbidden on preset
until now. 🤦♂️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
aside: looks like the only place we have docs on this is in https://babeljs.io/docs/en/configuration#print-effective-configs? Maybe should link to it in the options/config page as well https://babeljs.io/docs/en/config-files?
Or also suggest running when encountering certain kinds of errors
A good idea would be adding it to the issue template 👍 |
I will mark this PR ready when the Windows CI is green.
The test fixtures are updated because now Babel will actually resolve presets and transform the code. It turns out the complex config in out test cases is not a valid config.