if (asset_config_path = Rails.root.join("config/initializers/assets.rb")).exist?
say "Add node_modules to the asset load path"
append_to_file asset_config_path, <<-RUBY
# Add node_modules folder to the asset load path.
Rails.application.config.assets.paths << Rails.root.join("node_modules")
RUBY
end
This change added to v6 is probably no longer necessary. Instead, we can probably document why one would do this.
https://github.com/rails/webpacker/commit/47b1e0662aed1649110ab25f3f178da588ddf670