forked from digitalocean/sample-gatsby
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgatsby-node.js
25 lines (23 loc) · 871 Bytes
/
gatsby-node.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/**
* Implement Gatsby's Node APIs in this file.
*
* See: https://www.gatsbyjs.com/docs/node-apis/
*/
// You can delete this file if you're not using it
exports.onCreatePage = async ({ page, actions: { createPage } }) => {
/*
* The dashboard and other pages (account,settings, my insights)
* (which lives under `/dashboard` and `/*`) are client-only route.
* That means that we don’t want to build them server-side because it depends
* on data that we won’t have until a user logs in. By using `matchPath`,
* we’re able to specify the entire `/dashboard` path as a client-only section,
* which means Gatsby will skip any `/dashboard/*` and `/* /*` pages during
* the build step.
*
* Take a look at `src/pages/dashboard.js` for more details.
*/
if (page.path === `/`) {
page.matchPath = `/*`
createPage(page)
}
}