diff options
Diffstat (limited to 'app/helpers/webpack_helper.rb')
-rw-r--r-- | app/helpers/webpack_helper.rb | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/app/helpers/webpack_helper.rb b/app/helpers/webpack_helper.rb index 33453dd178f..94887c2cbd2 100644 --- a/app/helpers/webpack_helper.rb +++ b/app/helpers/webpack_helper.rb @@ -1,12 +1,12 @@ require 'webpack/rails/manifest' module WebpackHelper - def webpack_bundle_tag(bundle) - javascript_include_tag(*gitlab_webpack_asset_paths(bundle)) + def webpack_bundle_tag(bundle, force_same_domain: false) + javascript_include_tag(*gitlab_webpack_asset_paths(bundle, force_same_domain: true)) end # override webpack-rails gem helper until changes can make it upstream - def gitlab_webpack_asset_paths(source, extension: nil) + def gitlab_webpack_asset_paths(source, extension: nil, force_same_domain: false) return "" unless source.present? paths = Webpack::Rails::Manifest.asset_paths(source) @@ -14,9 +14,11 @@ module WebpackHelper paths.select! { |p| p.ends_with? ".#{extension}" } end - force_host = webpack_public_host - if force_host - paths.map! { |p| "#{force_host}#{p}" } + unless force_same_domain + force_host = webpack_public_host + if force_host + paths.map! { |p| "#{force_host}#{p}" } + end end paths |