diff --git a/railties/lib/rails/generators/app_base.rb b/railties/lib/rails/generators/app_base.rb index b85bf874a6..c02b39d203 100644 --- a/railties/lib/rails/generators/app_base.rb +++ b/railties/lib/rails/generators/app_base.rb @@ -252,7 +252,7 @@ module Rails end def assets_gemfile_entry - return [] if options[:skip_sprockets] || options[:api] + return [] if options[:skip_sprockets] gems = [] gems << GemfileEntry.version('sass-rails', '~> 5.0', @@ -280,7 +280,7 @@ module Rails end def javascript_gemfile_entry - if options[:skip_javascript] || options[:api] + if options[:skip_javascript] [] else gems = [coffee_gemfile_entry, javascript_runtime_gemfile_entry] diff --git a/railties/lib/rails/generators/rails/app/app_generator.rb b/railties/lib/rails/generators/rails/app/app_generator.rb index d05fb55212..d0e957037a 100644 --- a/railties/lib/rails/generators/rails/app/app_generator.rb +++ b/railties/lib/rails/generators/rails/app/app_generator.rb @@ -191,7 +191,7 @@ module Rails # Force sprockets to be skipped when generating http only app. # Can't modify options hash as it's frozen by default. - self.options = options.merge(skip_sprockets: true).freeze if options[:api] + self.options = options.merge(skip_sprockets: true, skip_javascript: true).freeze if options[:api] end public_task :set_default_accessors!