Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add additional logging around conditional page builds #26748

Merged
merged 4 commits into from
Sep 4, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions packages/gatsby/src/commands/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,14 +209,22 @@ module.exports = async function build(program: IBuildArgs): Promise<void> {

// Rebuild subset of pages if user opt into GATSBY_EXPERIMENTAL_PAGE_BUILD_ON_DATA_CHANGES
// if there were no source files (for example components, static queries, etc) changes since last build, otherwise rebuild all pages
if (
process.env.GATSBY_EXPERIMENTAL_PAGE_BUILD_ON_DATA_CHANGES &&
cachedWebpackCompilationHash === store.getState().webpackCompilationHash
) {
pagePaths = buildUtils.getChangedPageDataKeys(
store.getState(),
cachedPageData
)
if (process.env.GATSBY_EXPERIMENTAL_PAGE_BUILD_ON_DATA_CHANGES) {
if (
cachedWebpackCompilationHash === store.getState().webpackCompilationHash
) {
pagePaths = buildUtils.getChangedPageDataKeys(
store.getState(),
cachedPageData
)
} else if (cachedWebpackCompilationHash) {
report.info(
report.stripIndent(`
One or more of your source files have changed since the last time you ran Gatsby. All
pages will be rebuilt.
`)
)
}
}

const buildHTMLActivityProgress = report.createProgress(
Expand Down