diff --git a/railties/lib/rails/generators/rails/app/templates/gitignore b/railties/lib/rails/generators/rails/app/templates/gitignore index 709b341387..1768b700d9 100644 --- a/railties/lib/rails/generators/rails/app/templates/gitignore +++ b/railties/lib/rails/generators/rails/app/templates/gitignore @@ -23,6 +23,7 @@ <% unless options[:skip_yarn] -%> /vendor/node_modules +/vendor/yarn-error.log <% end -%> .byebug_history diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb index ee996dc9d6..e80c253ec9 100644 --- a/railties/test/generators/app_generator_test.rb +++ b/railties/test/generators/app_generator_test.rb @@ -508,6 +508,11 @@ class AppGeneratorTest < Rails::Generators::TestCase assert_file "config/initializers/assets.rb" do |content| assert_no_match(/node_modules/, content) end + + assert_file ".gitignore" do |content| + assert_no_match(/vendor\/node_modules/, content) + assert_no_match(/vendor\/yarn-error\.log/, content) + end end def test_inclusion_of_jbuilder