rails / webpacker

Use Webpack to manage app-like JavaScript modules in Rails
MIT License
5.31k stars 1.47k forks source link

Remove addition of node_modules to Rails.application.config.assets.paths #3261

Closed justin808 closed 2 years ago

justin808 commented 2 years ago

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

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
justin808 commented 2 years ago

See https://github.com/shakacode/shakapacker/issues/15.