FIX: Support transpiling js in plugins with a root admin folder
This commit is contained in:
parent
a40649409e
commit
3cce1b4e78
|
@ -533,6 +533,7 @@ class Plugin::Instance
|
|||
|
||||
if transpile_js
|
||||
DiscourseJsProcessor.plugin_transpile_paths << root_path.sub(Rails.root.to_s, '').sub(/^\/*/, '')
|
||||
DiscourseJsProcessor.plugin_transpile_paths << admin_path.sub(Rails.root.to_s, '').sub(/^\/*/, '')
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -674,8 +675,9 @@ class Plugin::Instance
|
|||
if @path
|
||||
# Automatically include all ES6 JS and hbs files
|
||||
root_path = "#{File.dirname(@path)}/assets/javascripts"
|
||||
admin_path = "#{File.dirname(@path)}/admin/assets/javascripts"
|
||||
|
||||
Dir.glob("#{root_path}/**/*") do |f|
|
||||
Dir.glob(["#{root_path}/**/*", "#{admin_path}/**/*"]) do |f|
|
||||
f_str = f.to_s
|
||||
if File.directory?(f)
|
||||
yield [f, true]
|
||||
|
|
Loading…
Reference in New Issue