Commit b3734ec8 authored by Mike Greiling's avatar Mike Greiling

prevent duplicate chunks from being loaded in webpack_helper

parent 9328c75e
......@@ -33,7 +33,7 @@ module WebpackHelper
javascript_include_tag(*chunks)
end
def entrypoint_paths(source, extension: nil)
def entrypoint_paths(source, extension: nil, exclude_duplicates: true)
return "" unless source.present?
paths = Gitlab::Webpack::Manifest.entrypoint_paths(source)
......@@ -46,8 +46,15 @@ module WebpackHelper
paths.map! { |p| "#{force_host}#{p}" }
end
if exclude_duplicates
@used_paths ||= []
new_paths = paths - @used_paths
@used_paths += new_paths
new_paths
else
paths
end
end
def webpack_public_host
if Rails.env.test? && Rails.configuration.webpack.dev_server.enabled
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment