-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Preset's name for scoped packages #8236
Comments
Hey @artola! We really appreciate you taking the time to report an issue. The collaborators If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack |
Please indicate the version of Babel you are using. |
The same way we auto-prefix packages with I suppose one option we could consider would be to loosen those requirements when a scope is in use, and only append I'll also say that adding a |
@xtuc version: 7.0.0-beta.51 with "babel-loader": "^8.0.0-beta.4", |
@artola Multiple-pass resolution was an ongoing pain point for us in Babel 6 because it was a frequent source of confusion, especially when people forgot to install presets. By expecting a strict 1-1 mapping, it allows Babel to give much more useful feedback when errors happen. I don't think I'd be willing to revert that. I'd certainly be happy to discuss alternative ways to handle how the 1-1 mapping is generated though, as I mentioned above. |
@loganfsmyth I do believe that module resolution for
I would like to just do it transparently and supported by API/documentation in a way that a change to the resolution mechanism triggers a major version. |
Just a thought - given the major version jump of babel 7 and the built-in packages changing to I ran into an interesting issue where I copied my This was OK when babel's own packages followed the same |
I have
presets
for all the parts in the tool-chain, from Jest to TSLint. Then I did the same for Babel.The preset works perfectly, if the name is "babel-preset-xxx", but we prefix all our react stuff then the package become "@company/rdk.babel-preset-xxx".
Now if I try to use it in webpack as:
THIS BREAKS :( ... with this message:
As the hint says, prefixing with
module:
works. But also just suffixing with/
. I mean, both options works:presets: ['module:@company/rdk.babel-preset-xxx']
and/orpresets: ['@company/rdk.babel-preset-xxx/']
Is this documented in some place? Could be possible scoped packages different than
@babel/
to be resolved using node resolution before Babel's resolution ?The text was updated successfully, but these errors were encountered: