mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 17:13:25 +08:00
DEV: Support colocation under /admin
namespace in themes/plugins (#19353)
This commit is contained in:
@ -89,8 +89,6 @@ class ThemeJavascriptCompiler
|
||||
end
|
||||
|
||||
def append_tree(tree, for_tests: false)
|
||||
root_name = "discourse"
|
||||
|
||||
# Replace legacy extensions
|
||||
tree.transform_keys! do |filename|
|
||||
if filename.ends_with? ".js.es6"
|
||||
@ -121,7 +119,7 @@ class ThemeJavascriptCompiler
|
||||
|
||||
# Handle colocated components
|
||||
tree.dup.each_pair do |filename, content|
|
||||
is_component_template = filename.end_with?(".hbs") && filename.start_with?("#{root_name}/components/")
|
||||
is_component_template = filename.end_with?(".hbs") && filename.start_with?("discourse/components/", "admin/components/")
|
||||
next if !is_component_template
|
||||
template_contents = content
|
||||
|
||||
|
Reference in New Issue
Block a user