mirror of
https://github.com/discourse/discourse.git
synced 2025-09-06 10:50:21 +08:00
Insert middleware in production mode if enabled
This commit is contained in:
parent
8d4cff642e
commit
fffa285dbf
2 changed files with 6 additions and 13 deletions
|
@ -263,11 +263,6 @@ class Plugin::Instance
|
||||||
themes << theme
|
themes << theme
|
||||||
end
|
end
|
||||||
|
|
||||||
# def register_public
|
|
||||||
# return unless enabled?
|
|
||||||
#
|
|
||||||
# end
|
|
||||||
|
|
||||||
def automatic_assets
|
def automatic_assets
|
||||||
css = styles.join("\n")
|
css = styles.join("\n")
|
||||||
js = javascripts.join("\n")
|
js = javascripts.join("\n")
|
||||||
|
|
|
@ -17,14 +17,12 @@ class Plugin::Theme
|
||||||
def register_public
|
def register_public
|
||||||
public_dir = "#{@plugin.directory}/public"
|
public_dir = "#{@plugin.directory}/public"
|
||||||
if File.exist?(public_dir)
|
if File.exist?(public_dir)
|
||||||
if Rails.env.development?
|
Rails.application.config.before_initialize do |app|
|
||||||
Rails.application.config.before_initialize do |app|
|
app.middleware.insert_before(
|
||||||
app.middleware.insert_before(
|
::ActionDispatch::Static,
|
||||||
::ActionDispatch::Static,
|
::ActionDispatch::Static,
|
||||||
::ActionDispatch::Static,
|
public_dir
|
||||||
public_dir
|
)
|
||||||
)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue