-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Parcel 2 not picking up babel configuration in a yarn monorepo #6119
Comments
I actually HAD TO add a package-lock.json (even an empty one works) in the subrepo to have the subrepo babel.config.json to be used by parcel. You can see in the doc that a package.json is not enough for parcel to consider a directory as a project directory, which is pretty confusing I think. |
Well That's cute. Dropping an empty package-lock.json in the subrepo did indeed solve the problem, a million thanks for the workaround! |
Adding package-lock.json files is not the correct solution. Parcel just uses Babel's config resolution here, so this section applies: https://babeljs.io/docs/en/config-files#monorepos (so the "usual" approach of .babelrc's doesn't work in monorepos) |
As described in the linked docs, you need to add a babel.config.json file in the root containing:
|
🐛 bug report
🎛 Configuration (.babelrc, package.json, cli command)
Currently it seems that in a yarn monorepo, parcel does not pick up neither .babelrc, nor "babel" entry of package.json, whether its located at the workspace root or subrepo root.
🤔 Expected Behavior
The linked repo should build. Babel configuration in a subrepo root should be respected, or at the very least info should be provided where to put babel configuration in a monorepo in order for it to get respected by parcel
😯 Current Behavior
In a monorepo parcel complains about absence of plugin that is defined in .babelrc, regardless of .babelrc location
💁 Possible Solution
🔦 Context
I am trying to build a subrepo using parcel. Subrepo uses private class fields.
💻 Code Sample
the repo used to demonstrate the bug supposedly fixed in #4132 still does not build neither with beta.2 nor with nightly.639
🌍 Your Environment
The text was updated successfully, but these errors were encountered: