Skip to content

Commit 930a71c

Browse files
committed
Add logging
1 parent 20c2bc1 commit 930a71c

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "gatsby-plugin-netlify",
2+
"name": "@ascorbic/gatsby-plugin-netlify",
33
"description": "A Gatsby plugin which generates a _headers file for netlify",
44
"version": "4.0.0-0",
55
"author": "Kyle Mathews <[email protected]>",

src/gatsby-node.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,13 @@ exports.onPostBuild = async (
3232
const pluginOptions = { ...DEFAULT_OPTIONS, ...userPluginOptions }
3333

3434
const { redirects, pages } = store.getState()
35-
35+
reporter.info(`[gatsby-plugin-netlify] Creating SSR redirects...`)
36+
let count = 0
3637
const rewrites = []
3738
Array.from(pages.values()).forEach(page => {
3839
const { mode, matchPath, path } = page
3940
if (mode === `SSR`) {
41+
count++
4042
rewrites.push(
4143
{
4244
fromPath: matchPath ?? path,
@@ -53,6 +55,11 @@ exports.onPostBuild = async (
5355
// toPath: page.path,
5456
// }
5557
})
58+
reporter.info(
59+
`[gatsby-plugin-netlify] Creating ${count} SSR redirect${
60+
count === 1 ? `` : `s`
61+
}...`
62+
)
5663

5764
await Promise.all([
5865
buildHeadersProgram(pluginData, pluginOptions, reporter),

0 commit comments

Comments
 (0)