Skip to content

Commit adec7e7

Browse files
author
David Heinemeier Hansson
authored
Sprockets shouldn't be in debug mode by default in development (rails#42984)
* Sprockets shouldn't be in debug mode by default in development As we move to separate files with ESM, we won't be concatenating or even preprocessing large JavaScript at all. Debug mode is thus irrelevant. * Debug mode is no longer default
1 parent 0375657 commit adec7e7

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

railties/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,6 @@ Rails.application.configure do
6262

6363
<%- end -%>
6464
<%- unless options.skip_sprockets? -%>
65-
# Debug mode disables concatenation and preprocessing of assets.
66-
# This option may cause significant delays in view rendering with a large
67-
# number of complex assets.
68-
config.assets.debug = true
69-
7065
# Suppress logger output for asset requests.
7166
config.assets.quiet = true
7267
<%- end -%>

railties/test/application/assets_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -472,9 +472,9 @@ class ::PostsController < ActionController::Base ; end
472472
class ::PostsController < ActionController::Base; end
473473

474474
get "/posts", {}, { "HTTPS" => "off" }
475-
assert_match('src="http://example.com/assets/application.debug.js', last_response.body)
475+
assert_match('src="http://example.com/assets/application.js', last_response.body)
476476
get "/posts", {}, { "HTTPS" => "on" }
477-
assert_match('src="https://example.com/assets/application.debug.js', last_response.body)
477+
assert_match('src="https://example.com/assets/application.js', last_response.body)
478478
end
479479

480480
test "asset URLs should be protocol-relative if no request is in scope" do

0 commit comments

Comments
 (0)