mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
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
|
if transpile_js
|
||||||
DiscourseJsProcessor.plugin_transpile_paths << root_path.sub(Rails.root.to_s, '').sub(/^\/*/, '')
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -674,8 +675,9 @@ class Plugin::Instance
|
|||||||
if @path
|
if @path
|
||||||
# Automatically include all ES6 JS and hbs files
|
# Automatically include all ES6 JS and hbs files
|
||||||
root_path = "#{File.dirname(@path)}/assets/javascripts"
|
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
|
f_str = f.to_s
|
||||||
if File.directory?(f)
|
if File.directory?(f)
|
||||||
yield [f, true]
|
yield [f, true]
|
||||||
|
Loading…
Reference in New Issue
Block a user