ensure parent entrypoint is loaded if direct one is unavailable
This commit is contained in:
parent
f9e33f43c0
commit
b2d90ea1fb
1 changed files with 11 additions and 5 deletions
|
@ -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('.')}"
|
|
||||||
|
|
||||||
|
until chunks.any? || route.empty?
|
||||||
|
entrypoint = "pages.#{route.join('.')}"
|
||||||
begin
|
begin
|
||||||
chunks = entrypoint_paths(entrypoint, extension: 'js')
|
chunks = entrypoint_paths(entrypoint, extension: 'js')
|
||||||
rescue Gitlab::Webpack::Manifest::AssetMissingError
|
rescue Gitlab::Webpack::Manifest::AssetMissingError
|
||||||
# no bundle exists for this path
|
# 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
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue