mirror of
https://github.com/discourse/discourse.git
synced 2026-08-08 12:08:12 -05:00
DEV: Display a warning when assets are precompiled in local env (#35323)
When precompiled assets exist, Propshaft will switch to a static mode and only serve those existing assets. This confuses people on a regular basis, so this patch addresses that issue by displaying a banner on STDOUT if precompiled assets exist in a local env (test or dev).
This commit is contained in:
@@ -222,6 +222,14 @@ module Discourse
|
||||
controller.action_methods
|
||||
end
|
||||
end
|
||||
|
||||
puts <<~WARNING if Rails.env.local? && Rails.application.assets.config.manifest_path.exist?
|
||||
\e[1;31m==========================================================================
|
||||
WARNING: an asset manifest file exists. This means the assets won’t be
|
||||
compiled automatically, and will be served statically instead.
|
||||
To re-enable automatic compilation, you can run `bin/rails assets:clobber`
|
||||
==========================================================================\e[0m
|
||||
WARNING
|
||||
end
|
||||
|
||||
require "rbtrace" if ENV["RBTRACE"] == "1"
|
||||
|
||||
Reference in New Issue
Block a user