-
-
Notifications
You must be signed in to change notification settings - Fork 451
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
Babel Loader ignores webpack resolve config for its own plugins #895
Comments
This is expected, the babel plugin is not loaded by webpack, instead it is resolved using node Can you share a reproduction repo? |
Babel allows you to directly use module.exports = {
plugins: [
require("../../custom-path/@babel/plugin-proposal-decorators")
]
} |
Thx for the fast responses! @JLHwung I did fast create a reproducer based on our setup we use in sulu/skeleton here: https://github.com/alexander-schranz/build-error-reproducer. If you go there into the
@nicolo-ribaudo directly require the plugins is sadly not an option as we are not in control of all the |
@JLHwung a fallback to process.cwd to load modules would fix this issue. Not sure if this would be correct way to handle this. https://github.com/babel/babel/pull/12986/files |
Webpack Version:
Babel Core Version:
Babel Loader Version:
Please tell us about your environment:
OSX 10.14.6
Current behavior:
Expected/desired behavior:
Find Babel plugin.
We have an uncommen directory structure which looks like the following:
The vendors are added as babelRoots:
because how npm works we need to override webpack module resolver to something like this:
but it looks like babel-loader itself does not use this webpack config to load the plugin and so it ends with:
I would expect that the resolve config of weback is used to find the
@babel/plugin-proposal-decorators
module.Fixing problem with a custom dependency resolve configuration.
The text was updated successfully, but these errors were encountered: