Skip to content

Commit 1b739e8

Browse files
authored
feat: show summary build status (#400)
* feat: show summary build status * fix: merge error
1 parent 5064aa3 commit 1b739e8

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

index.js

+8
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,21 @@ module.exports = {
8484

8585
async onPostBuild({ netlifyConfig, packageJson, constants: { FUNCTIONS_DIST = DEFAULT_FUNCTIONS_DIST }, utils }) {
8686
if (doesNotNeedPlugin({ netlifyConfig, packageJson, utils })) {
87+
utils.status.show({
88+
title: 'Essential Next.js Build Plugin did not run',
89+
summary: 'The site either uses static export, or manually runs next-on-netlify',
90+
})
8791
return
8892
}
8993
const nextRoot = getNextRoot({ netlifyConfig })
9094

9195
const nextConfig = await getNextConfig(utils.failBuild, nextRoot)
9296
await saveCache({ cache: utils.cache, distDir: nextConfig.distDir })
9397
copyUnstableIncludedDirs({ nextConfig, functionsDist: path.resolve(FUNCTIONS_DIST) })
98+
utils.status.show({
99+
title: 'Essential Next.js Build Plugin ran successfully',
100+
summary: 'Generated serverless functions and stored the Next.js cache',
101+
})
94102
},
95103
}
96104

test/index.js

+3
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ const utils = {
2424
save() {},
2525
restore() {},
2626
},
27+
status: {
28+
show() {},
29+
},
2730
}
2831

2932
// Temporary switch cwd

0 commit comments

Comments
 (0)