mirror of
https://github.com/discourse/discourse.git
synced 2025-05-21 18:12:32 +08:00
When using automatic file includes (es6, hbs) from plugins, allow the
asset pipeline to find new and deleted files with deleting the `tmp` folder and restarting the server.
This commit is contained in:
@ -26,19 +26,10 @@ class Plugin::Instance
|
||||
@color_schemes = []
|
||||
|
||||
if @path
|
||||
|
||||
# Automatically include all ES6 JS files
|
||||
dir = File.dirname(@path)
|
||||
Dir.glob("#{dir}/assets/javascripts/**/*.js.es6") do |f|
|
||||
relative = f.sub("#{dir}/assets/", "")
|
||||
register_asset(relative)
|
||||
end
|
||||
|
||||
# Automatically include all hbs files
|
||||
Dir.glob("#{dir}/assets/javascripts/**/*.hbs") do |f|
|
||||
relative = f.sub("#{dir}/assets/", "")
|
||||
register_asset(relative)
|
||||
end
|
||||
# Automatically include all ES6 JS and hbs files
|
||||
root_path = "#{File.dirname(@path)}/assets/javascripts"
|
||||
DiscoursePluginRegistry.register_glob(root_path, 'js.es6')
|
||||
DiscoursePluginRegistry.register_glob(root_path, 'hbs')
|
||||
end
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user