diff options
author | Mike Greiling <mike@pixelcog.com> | 2017-06-29 05:57:35 +0300 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2017-06-29 06:26:16 +0300 |
commit | 3137b886b84e2c3670b305a8194a3532afe541be (patch) | |
tree | 60a567b30ca001e9658076d534c90dfc4f17f9c3 /lib/gitlab/gon_helper.rb | |
parent | 5b43aa955737f002be3d197c9f7b4d3374d0ad69 (diff) |
configure webpack publicPath dynamically to account for CDN or relative path settings
Diffstat (limited to 'lib/gitlab/gon_helper.rb')
-rw-r--r-- | lib/gitlab/gon_helper.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/gitlab/gon_helper.rb b/lib/gitlab/gon_helper.rb index 319633656ff..2d1ae6a5925 100644 --- a/lib/gitlab/gon_helper.rb +++ b/lib/gitlab/gon_helper.rb @@ -2,11 +2,14 @@ module Gitlab module GonHelper + include WebpackHelper + def add_gon_variables gon.api_version = 'v4' gon.default_avatar_url = URI.join(Gitlab.config.gitlab.url, ActionController::Base.helpers.image_path('no_avatar.png')).to_s gon.max_file_size = current_application_settings.max_attachment_size gon.asset_host = ActionController::Base.asset_host + gon.webpack_public_path = webpack_public_path gon.relative_url_root = Gitlab.config.gitlab.relative_url_root gon.shortcuts_path = help_page_path('shortcuts') gon.user_color_scheme = Gitlab::ColorSchemes.for_user(current_user).css_class |