why runtime/chunk not processed by babel-loader?
See original GitHub issueBug report
What is the current behavior?
contain es6 syntax array destruction

If the current behavior is a bug, please provide the steps to reproduce.
// webpack.config.js
{
test: /\.(js|jsx|ts|tsx)$/,
exclude: [
/node_modules[\/
]core-js/,
/node_modules[\/
]webpack[\/
]buildin/,
],
use: [
{
loader: 'babel-loader',
options: {
cacheDirectory: true
}
},
{
loader: 'ts-loader',
options: {
transpileOnly: true,
},
},
],
}
// babel.config.json
{
"sourceType": "unambiguous",
"presets": [
[
"@babel/preset-env",
{
"useBuiltIns": "usage",
"modules": false,
"loose": true,
"corejs": {
"version": "3",
"proposals": true
}
}
],
"@babel/preset-react"
]
}
What is the expected behavior?
It should be like this

Other relevant information: webpack version: 5.74.0 Node.js version: v16.16.0 Operating System: macOS Monterey 12.0.1 (21A559) Additional tools: -
Issue Analytics
- State:
- Created a year ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Optimization - webpack
If you are using webpack CLI, the webpack process will not exit with an ... runtimeChunk to true or 'multiple' adds an additional...
Read more >Webpack 4 chunking different runtime behaviour compared to ...
If you want to run two modules in order at an entrypoint, use an array. You should not use the vendor chunk as...
Read more >React + Webpack 5 + Babel 7 IE11 issue -- not attaching to root
Issue: No matter what I do, I can't get anything inside my root div. There are no console errors at all in IE11....
Read more >Webpack 4 in production: How to make your life easier
In our case, we are telling webpack to use babel-loader for all JS files that are not located in node_modules directory. This enables...
Read more >Bundle optimization - Notes
cache/babel-loader or fallback to the default OS temporary file directory if no node_modules folder could be found in any root directory. Another useful ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Yes, webpack doesn’t run babel loader on generated runtime, it will be very bad for perf and increase output, so we have these variables (and get them from browserslist for better DX)
Anyway if you want to say webpack don’t generate it you can use https://webpack.js.org/configuration/output/#outputenvironment and set
destructuringtofalse