DEV: Support colocation under /admin namespace in themes/plugins (#19353)

This commit is contained in:
David Taylor
2022-12-07 14:24:03 +00:00
committed by GitHub
parent f2d0832618
commit 566793208e
4 changed files with 27 additions and 7 deletions

View File

@ -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