Today, I faced an issue where 3rd party dependency is broken after it is transpiled by node_modules loader.
I’m not 100% sure what was the intention, but based on the code it seems that loader tries to transpile code in each package, with the exception of babbel/webpack packages.
This means that not only webpacker dependancies are transiped, but the project specific ones as well. To me, this is just asking for trouble. It seems inevitable that things will break at some point.
After checking the exclude regex, it looks like the intention was to target @rails/actioncable and @rails/activestorage packages. Since these packages are distributed with the transpiled code, is the node_modules loader even needed?