Commit b2d90ea1 authored by Mike Greiling's avatar Mike Greiling

ensure parent entrypoint is loaded if direct one is unavailable

parent f9e33f43
...@@ -15,12 +15,18 @@ module WebpackHelper ...@@ -15,12 +15,18 @@ module WebpackHelper
end end
route = [*controller.controller_path.split('/'), action].compact route = [*controller.controller_path.split('/'), action].compact
entrypoint = "pages.#{route.join('.')}"
begin until chunks.any? || route.empty?
chunks = entrypoint_paths(entrypoint, extension: 'js') entrypoint = "pages.#{route.join('.')}"
rescue Gitlab::Webpack::Manifest::AssetMissingError begin
# no bundle exists for this path chunks = entrypoint_paths(entrypoint, extension: 'js')
rescue Gitlab::Webpack::Manifest::AssetMissingError
# no bundle exists for this path
end
route.pop
end
if chunks.empty?
chunks = entrypoint_paths("default", extension: 'js') chunks = entrypoint_paths("default", extension: 'js')
end end
......
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