1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Sprockets shouldn't be in debug mode by default in development (#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
This commit is contained in:
David Heinemeier Hansson 2021-08-10 12:27:50 +02:00 committed by GitHub
parent 0375657ce0
commit adec7e7ba8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 7 deletions

View file

@ -62,11 +62,6 @@ Rails.application.configure do
<%- end -%>
<%- unless options.skip_sprockets? -%>
# Debug mode disables concatenation and preprocessing of assets.
# This option may cause significant delays in view rendering with a large
# number of complex assets.
config.assets.debug = true
# Suppress logger output for asset requests.
config.assets.quiet = true
<%- end -%>

View file

@ -472,9 +472,9 @@ module ApplicationTests
class ::PostsController < ActionController::Base; end
get "/posts", {}, { "HTTPS" => "off" }
assert_match('src="http://example.com/assets/application.debug.js', last_response.body)
assert_match('src="http://example.com/assets/application.js', last_response.body)
get "/posts", {}, { "HTTPS" => "on" }
assert_match('src="https://example.com/assets/application.debug.js', last_response.body)
assert_match('src="https://example.com/assets/application.js', last_response.body)
end
test "asset URLs should be protocol-relative if no request is in scope" do