### 💻 - [ ] Would you like to work on a fix? ### How are you using Babel? babel-loader (webpack) ### Input code https://babeljs.io/repl#?browsers=last%202%20versions&build=&builtIns=false&corejs=3.21&spec=false&loose=false&code_lz=MYGwhgzhAEDKvQN4ChrQJDAPYDsIBcAnAV2Hy0IAocwBbAUwEoV1p8ALASwgDoaHoAXmgByKCIDU_egG5UaBcnQBfZKuShIMAILbo9AB756OACYx4SeZlwESZCtTpMUChRGIAHelWmM5bmgc3HzOQqJgYCLQUs5yKshKkQDihPT0-JQQzEroHt6EPADmaRkA_DxZMaLstSL-Sqrq2Hj40GDhOPQA7tC6lCIAVmDAANb1cshgPCmlmSKm9UA&debug=false&forceAllTransforms=false&modules=commonjs&shippedProposals=false&evaluate=false&fileSize=false&timeTravel=false&sourceType=module&lineWrap=true&presets=env&prettier=false&targets=&version=7.25.4&externalPlugins=%40babel%2Fplugin-transform-modules-commonjs%407.21.2&assumptions=%7B%7D ### Configuration file name _No response_ ### Configuration _No response_ ### Current and expected behavior Current: got tranformed code losing optional chain check logic, which causes an undefined.apply error expected: tranformed code should remain the optional chain check logic ### Environment - Babel version(s): 7.25.2 - Node: 16 - pnpm version: 8.8.0 - OS: macos Sonoma - Mac with apple chip ### Possible solution _No response_ ### Additional context _No response_
💻
How are you using Babel?
babel-loader (webpack)
Input code
https://babeljs.io/repl#?browsers=last%202%20versions&build=&builtIns=false&corejs=3.21&spec=false&loose=false&code_lz=MYGwhgzhAEDKvQN4ChrQJDAPYDsIBcAnAV2Hy0IAocwBbAUwEoV1p8ALASwgDoaHoAXmgByKCIDU_egG5UaBcnQBfZKuShIMAILbo9AB756OACYx4SeZlwESZCtTpMUChRGIAHelWmM5bmgc3HzOQqJgYCLQUs5yKshKkQDihPT0-JQQzEroHt6EPADmaRkA_DxZMaLstSL-Sqrq2Hj40GDhOPQA7tC6lCIAVmDAANb1cshgPCmlmSKm9UA&debug=false&forceAllTransforms=false&modules=commonjs&shippedProposals=false&evaluate=false&fileSize=false&timeTravel=false&sourceType=module&lineWrap=true&presets=env&prettier=false&targets=&version=7.25.4&externalPlugins=%40babel%2Fplugin-transform-modules-commonjs%407.21.2&assumptions=%7B%7D
Configuration file name
No response
Configuration
No response
Current and expected behavior
Current:
got tranformed code losing optional chain check logic, which causes an undefined.apply error
expected:
tranformed code should remain the optional chain check logic
Environment
Possible solution
No response
Additional context
No response