2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-08 12:06:51 +08:00

DEV: load styleguide assets only when needed (#10918)

This commit is contained in:
Joffrey JAFFEUX 2020-10-14 16:29:40 +02:00 committed by GitHub
parent 74de7a49f5
commit 73d207a568
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 0 deletions

View file

@ -13,3 +13,9 @@ load File.expand_path('../lib/styleguide/engine.rb', __FILE__)
Discourse::Application.routes.append do
mount ::Styleguide::Engine, at: '/styleguide'
end
after_initialize do
register_asset_filter do |type, request|
request&.fullpath&.start_with?('/styleguide')
end
end