This repository was archived by the owner on May 10, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +14
-9
lines changed Expand file tree Collapse file tree 3 files changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -6,15 +6,16 @@ const pages = [];
6
6
// Get pages using getStaticProps
7
7
const { routes } = getPrerenderManifest ( ) ;
8
8
9
- // Parse pages
9
+ // Parse static pages
10
10
Object . entries ( routes ) . forEach (
11
- ( [ route , { dataRoute, initialRevalidateSeconds } ] ) => {
11
+ ( [ route , { dataRoute, initialRevalidateSeconds, srcRoute } ] ) => {
12
12
// Ignore pages with revalidate, these will need to be SSRed
13
13
if ( initialRevalidateSeconds ) return ;
14
14
15
15
pages . push ( {
16
16
route,
17
17
dataRoute,
18
+ srcRoute
18
19
} ) ;
19
20
}
20
21
) ;
Original file line number Diff line number Diff line change @@ -11,8 +11,8 @@ const pages = require("./pages");
11
11
12
12
const redirects = [ ] ;
13
13
14
- pages . forEach ( ( { route, dataRoute } ) => {
15
- const relativePath = getFilePathForRoute ( route , "js" ) ;
14
+ pages . forEach ( ( { route, dataRoute, srcRoute } ) => {
15
+ const relativePath = getFilePathForRoute ( srcRoute || route , "js" ) ;
16
16
const filePath = join ( "pages" , relativePath ) ;
17
17
const functionName = getNetlifyFunctionName ( filePath ) ;
18
18
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ const setup = () => {
13
13
NETLIFY_PUBLISH_PATH
14
14
) ;
15
15
16
- pages . forEach ( ( { route, dataRoute } ) => {
16
+ pages . forEach ( ( { route, dataRoute, srcRoute } ) => {
17
17
logItem ( route ) ;
18
18
19
19
// Copy pre-rendered HTML page
@@ -25,10 +25,14 @@ const setup = () => {
25
25
setupStaticFileForPage ( jsonPath , dataRoute ) ;
26
26
27
27
// Set up the Netlify function (this is ONLY for preview mode)
28
- const relativePath = getFilePathForRoute ( route , "js" ) ;
29
- const filePath = join ( "pages" , relativePath ) ;
30
- logItem ( filePath ) ;
31
- setupNetlifyFunctionForPage ( filePath ) ;
28
+ if ( srcRoute ) {
29
+ // is this taken care of in the other getStaticProps steps? unclear
30
+ } else if ( ! srcRoute ) {
31
+ const relativePath = getFilePathForRoute ( route , "js" ) ;
32
+ const filePath = join ( "pages" , relativePath ) ;
33
+ logItem ( filePath ) ;
34
+ setupNetlifyFunctionForPage ( filePath ) ;
35
+ }
32
36
} ) ;
33
37
} ;
34
38
You can’t perform that action at this time.
0 commit comments