When you set "externalHelpers": true, SWC will inject ESM style imports for helpers by default.
It can be a problem when using commonjs modules. SWC will end up still injecting an ESM import and then you'd have a module with mixed import syntax.
This can cause many problems down the road.
For instance what i ran into was that since the injected import is at the top, Rspack thought that my commonjs module is actually an ESM module because the first import statement was esm (which was injected by swc).
When you set
"externalHelpers": true, SWC will inject ESM style imports for helpers by default.It can be a problem when using commonjs modules. SWC will end up still injecting an ESM import and then you'd have a module with mixed import syntax.
This can cause many problems down the road.
For instance what i ran into was that since the injected import is at the top, Rspack thought that my commonjs module is actually an ESM module because the first import statement was esm (which was injected by swc).