File tree Expand file tree Collapse file tree 2 files changed +9
-8
lines changed
packages/gatsby-cli/src/reporter/loggers Expand file tree Collapse file tree 2 files changed +9
-8
lines changed Original file line number Diff line number Diff line change 22import React , { ReactElement , useContext } from "react"
33import { Box , Text , BoxProps , Spacer } from "ink"
44import path from "path"
5+ import { getPathToLayoutComponent } from "gatsby-core-utils"
56import StoreStateContext from "../context"
67import {
78 generatePageTree ,
@@ -117,7 +118,8 @@ const ConnectedPageTree: React.FC = function ConnectedPageTree() {
117118 const componentWithPages = new Map < string , IComponentWithPageModes > ( )
118119
119120 for ( const { componentPath, pages } of state . pageTree ! . components . values ( ) ) {
120- const pagesByMode = {
121+ const layoutComponent = getPathToLayoutComponent ( componentPath )
122+ const pagesByMode = componentWithPages . get ( layoutComponent ) || {
121123 SSG : new Set < string > ( ) ,
122124 DSG : new Set < string > ( ) ,
123125 SSR : new Set < string > ( ) ,
@@ -128,8 +130,7 @@ const ConnectedPageTree: React.FC = function ConnectedPageTree() {
128130
129131 pagesByMode [ gatsbyPage ! . mode ] . add ( pagePath )
130132 } )
131-
132- componentWithPages . set ( componentPath , pagesByMode )
133+ componentWithPages . set ( layoutComponent , pagesByMode )
133134 }
134135
135136 for ( const {
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ import {
1717 IComponentWithPageModes ,
1818} from "../../../util/generate-page-tree"
1919import { IRenderPageArgs } from "../../types"
20+ import { getPathToLayoutComponent } from "gatsby-core-utils"
2021
2122interface IYurnalistActivities {
2223 [ activityId : string ] : {
@@ -34,7 +35,9 @@ function generatePageTreeToConsole(
3435 const root = state . root
3536 const componentWithPages = new Map < string , IComponentWithPageModes > ( )
3637 for ( const { componentPath, pages } of state . components . values ( ) ) {
37- const pagesByMode = {
38+ const layoutComponent = getPathToLayoutComponent ( componentPath )
39+ const relativePath = path . posix . relative ( root , layoutComponent )
40+ const pagesByMode = componentWithPages . get ( relativePath ) || {
3841 SSG : new Set < string > ( ) ,
3942 DSG : new Set < string > ( ) ,
4043 SSR : new Set < string > ( ) ,
@@ -46,10 +49,7 @@ function generatePageTreeToConsole(
4649 pagesByMode [ gatsbyPage ! . mode ] . add ( pagePath )
4750 } )
4851
49- componentWithPages . set (
50- path . posix . relative ( root , componentPath ) ,
51- pagesByMode
52- )
52+ componentWithPages . set ( relativePath , pagesByMode )
5353 }
5454
5555 for ( const {
You can’t perform that action at this time.
0 commit comments