Is webpacker required for using node_modules in rails

I got started using node_modules and webpacker at the same time Now I’m no longer using webpacker in my rails 7 apps so can I still use node_modules with yarn?

you don’t need webpacker to use node_modules and yarn

For example, a clean Rails 5.2 app that didn’t have webpacker by default used yarn and node_modules by default back then, you just need to make sure you have the correct settings for whatever tool you use to point to the node_modules folder

rails_5_2_sample/assets.rb at master · fastruby/rails_5_2_sample · GitHub this was telling sprockets for example to look for files in node_modules