-
Notifications
You must be signed in to change notification settings - Fork 116
.babelrc
should be looked up in parent directories
#188
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
Labels
type: bug
code to address defects in shipped code
Comments
.babelrc
in parent directories.babelrc
should be looked up in parent directories
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Robin-Hoodie
added a commit
to Robin-Hoodie/netlify-lambda
that referenced
this issue
Jan 13, 2021
I've added find-up as a dependency for finding the babel config file. The babel config files to look for have been taken from @babel/core's sourcecode Finally, as babel-loader itself will by default not look outside of the cwd for the config file, we don't want to have false positives for any babel config files that exist outside of the cwd Closes netlify#200, netlify#188
Fixed via #364 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
At the moment, the
.babelrc
is only looked up in the current directory. However I thinkbabel/loader
forwards thebabelrc
option tobabel
, which then looks up any babel configuration file. So the current logic might consider the user has no Babel configuration, even though they do.This is especially likely inside monorepos.
Another issue is that Babel configurations can also be called
babel.config.js
,.babelrc.js
or be ababel
property insidepackage.json
.Checking the parent directories would be easy to implement (e.g. using
find-up
).A more proper way might be to use the
@babel/core
package though, and use their methods to check if there's a Babel configuration.The text was updated successfully, but these errors were encountered: