-
-
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
Can not compile code under the node_modules #736
Comments
I got progress a bit, if I convert That's odd 🤔 |
It's because .babelrc doesn't "leak" across different packages (delimited by package.json) |
I also fell into this trap... |
In previous versions of
This is no longer true when defining config inside |
same bug here with
If I use workaround is to change |
It's not a bug.
|
@stevenChen2022 It seems to me that {
test: /\.(jsx|js)$/,
exclude: {
and: [/node_modules/], // Exclude libraries in node_modules ...
not: [
// Except for a few of them that needs to be transpiled because they use modern syntax
/@restart[\\/]ui/
]
},
use: {
loader: 'babel-loader',
options: {
presets: [
['@babel/preset-env', { targets: "ie 11" }]
]
}
}
} See also https://github.com/babel/babel-loader#some-files-in-my-node_modules-are-not-transpiled-for-ie-11 Closing this issue as babel-loader is working as expected. |
I'm submitting a bug report
Webpack Version:
4.25.1
Babel Core Version:
7.1.5
Babel Loader Version:
8.0.4
Please tell us about your environment:
MacOS 10.13.6
Current behavior:
I want to compile codes through the babel also exists under the
node_modules
.Expected/desired behavior:
The bebel compiles codes under the node_modules properly, but without my own
.babelrc
.(In the other word, it compiles without any presets and also plugins)
I'd created a repository which reproduces the behavior.
What is the expected behavior?
I'd expect if
babel-loader
compiles also code under the node_modules, those function using arrow expression might be function literal, too like here.The text was updated successfully, but these errors were encountered: