I’m not 100% sure what was the intention… it looks like the intention was to target @rails/actioncable and @rails/activestorage packages.
In the beginning, node_modules
was excluded and everything was good. Then, A couple of issues were created complaining that JS from node_modules was not being transpiled. So, in webpacker@4.0, all JS in node_modules (even internal JS from testing libraries, webpack, and babel itself) would be transpiled. (I don’t think this was intended)
With this change, many users had to remove a loader from webpacker in order to get things working in 4.0.
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.
Not only broken but also slow since there can be 1000+ modules in node_modules
. Additional steps needed to be taken to prevent babel from transpiling webpack itself as well as the code that transpiles the code (thats the regex).
Since these packages are distributed with the transpiled code, is the node_modules loader even needed?
It acts like “training wheels” for those who want zero-config (at the hidden cost of speed).
This could help smooth things over: ‘node_modules’ compilation should be configurable through webpacker.yml #2075 ⭐️
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-core/1affb6fe-b6e7-4879-b442-7edf99d25cac%40googlegroups.com.
It acts like “training wheels” for those who want zero-config (at the hidden cost of speed).
Yes, it acts like a failsafe. There are just as many packages that break if you transpile as there are packages that break if you don’t. It all depends on what your package.json
contains.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-core/95bc0d46-d15b-48ab-836a-c7870a4a4f20%40googlegroups.com.