This repository was archived by the owner on May 10, 2021. It is now read-only.
File tree 13 files changed +31
-31
lines changed
13 files changed +31
-31
lines changed Original file line number Diff line number Diff line change 1
1
const { join } = require ( "path" ) ;
2
- const getNextDistDir = require ( "./getNextDistDir" ) ;
2
+ const getNextDistDir = require ( "./helpers/ getNextDistDir" ) ;
3
3
4
4
// This is where next-on-netlify will place all static files.
5
5
// The publish key in netlify.toml should point to this folder.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change 1
1
const { join } = require ( "path" ) ;
2
2
const { copySync } = require ( "fs-extra" ) ;
3
- const { logTitle } = require ( "./logger" ) ;
4
- const { NETLIFY_PUBLISH_PATH , NEXT_DIST_DIR } = require ( "./config" ) ;
3
+ const { logTitle } = require ( "../helpers /logger" ) ;
4
+ const { NETLIFY_PUBLISH_PATH , NEXT_DIST_DIR } = require ( ".. /config" ) ;
5
5
6
6
// Copy the NextJS' static assets from NextJS distDir to Netlify publish folder.
7
7
// These need to be available for NextJS to work.
Original file line number Diff line number Diff line change 1
1
const { existsSync, copySync } = require ( "fs-extra" ) ;
2
- const { logTitle } = require ( "./logger" ) ;
3
- const { NETLIFY_PUBLISH_PATH , PUBLIC_PATH } = require ( "./config" ) ;
2
+ const { logTitle } = require ( "../helpers /logger" ) ;
3
+ const { NETLIFY_PUBLISH_PATH , PUBLIC_PATH } = require ( ".. /config" ) ;
4
4
5
5
// Copy files from public folder to Netlify publish folder
6
6
const copyPublicFiles = ( ) => {
Original file line number Diff line number Diff line change 1
1
const { emptyDirSync } = require ( "fs-extra" ) ;
2
- const { logTitle, log } = require ( "./logger" ) ;
3
- const { NETLIFY_PUBLISH_PATH , NETLIFY_FUNCTIONS_PATH } = require ( "./config" ) ;
2
+ const { logTitle, log } = require ( "../helpers /logger" ) ;
3
+ const { NETLIFY_PUBLISH_PATH , NETLIFY_FUNCTIONS_PATH } = require ( ".. /config" ) ;
4
4
5
5
// Empty existing publish and functions folders
6
6
const prepareFolders = ( ) => {
Original file line number Diff line number Diff line change 1
1
const path = require ( "path" ) ;
2
2
const { join } = path ;
3
3
const { copySync, existsSync } = require ( "fs-extra" ) ;
4
- const { logTitle, logItem } = require ( "./logger" ) ;
5
- const { NEXT_DIST_DIR , NETLIFY_PUBLISH_PATH } = require ( "./config" ) ;
6
- const allNextJsPages = require ( "./allNextJsPages" ) ;
4
+ const { logTitle, logItem } = require ( "../helpers /logger" ) ;
5
+ const { NEXT_DIST_DIR , NETLIFY_PUBLISH_PATH } = require ( ".. /config" ) ;
6
+ const allNextJsPages = require ( ".. /allNextJsPages" ) ;
7
7
8
8
// Identify all pages that have been pre-rendered and copy each one to the
9
9
// Netlify publish directory.
Original file line number Diff line number Diff line change @@ -7,11 +7,11 @@ const {
7
7
const {
8
8
getSortedRoutes,
9
9
} = require ( "@sls-next/lambda-at-edge/dist/lib/sortedRoutes" ) ;
10
- const { logTitle, logItem } = require ( "./logger" ) ;
11
- const { NETLIFY_PUBLISH_PATH , CUSTOM_REDIRECTS_PATH } = require ( "./config" ) ;
12
- const allNextJsPages = require ( "./allNextJsPages" ) ;
13
- const getNetlifyRoute = require ( "./getNetlifyRoute" ) ;
14
- const getNetlifyFunctionName = require ( "./getNetlifyFunctionName" ) ;
10
+ const { logTitle, logItem } = require ( "../helpers /logger" ) ;
11
+ const { NETLIFY_PUBLISH_PATH , CUSTOM_REDIRECTS_PATH } = require ( ".. /config" ) ;
12
+ const allNextJsPages = require ( ".. /allNextJsPages" ) ;
13
+ const getNetlifyRoute = require ( "../helpers /getNetlifyRoute" ) ;
14
+ const getNetlifyFunctionName = require ( "../helpers /getNetlifyFunctionName" ) ;
15
15
16
16
// Setup _redirects file that routes all requests to the appropriate location:
17
17
// Either the relevant Netlify function or one of the pre-rendered HTML pages.
Original file line number Diff line number Diff line change 1
1
const path = require ( "path" ) ;
2
2
const { join } = path ;
3
3
const { copySync, existsSync } = require ( "fs-extra" ) ;
4
- const { logTitle, logItem } = require ( "./logger" ) ;
4
+ const { logTitle, logItem } = require ( "../helpers /logger" ) ;
5
5
const {
6
6
NEXT_DIST_DIR ,
7
7
NETLIFY_PUBLISH_PATH ,
8
8
NETLIFY_FUNCTIONS_PATH ,
9
9
FUNCTION_TEMPLATE_PATH ,
10
- } = require ( "./config" ) ;
11
- const allNextJsPages = require ( "./allNextJsPages" ) ;
12
- const getNetlifyFunctionName = require ( "./getNetlifyFunctionName" ) ;
10
+ } = require ( ".. /config" ) ;
11
+ const allNextJsPages = require ( ".. /allNextJsPages" ) ;
12
+ const getNetlifyFunctionName = require ( "../helpers /getNetlifyFunctionName" ) ;
13
13
14
14
// Identify all pages that require server-side rendering and create a separate
15
15
// Netlify Function for every page.
Original file line number Diff line number Diff line change 1
1
const path = require ( "path" ) ;
2
2
const { join } = path ;
3
3
const { copySync, existsSync } = require ( "fs-extra" ) ;
4
- const { logTitle, logItem } = require ( "./logger" ) ;
4
+ const { logTitle, logItem } = require ( "../helpers /logger" ) ;
5
5
const {
6
6
NEXT_DIST_DIR ,
7
7
NETLIFY_FUNCTIONS_PATH ,
8
8
FUNCTION_TEMPLATE_PATH ,
9
- } = require ( "./config" ) ;
10
- const allNextJsPages = require ( "./allNextJsPages" ) ;
11
- const getNetlifyFunctionName = require ( "./getNetlifyFunctionName" ) ;
9
+ } = require ( ".. /config" ) ;
10
+ const allNextJsPages = require ( ".. /allNextJsPages" ) ;
11
+ const getNetlifyFunctionName = require ( "../helpers /getNetlifyFunctionName" ) ;
12
12
13
13
// Identify all pages that require server-side rendering and create a separate
14
14
// Netlify Function for every page.
Original file line number Diff line number Diff line change @@ -9,14 +9,14 @@ program
9
9
)
10
10
. parse ( process . argv ) ;
11
11
12
- const { logTitle } = require ( "./lib/logger" ) ;
13
- const prepareFolders = require ( "./lib/prepareFolders" ) ;
14
- const copyPublicFiles = require ( "./lib/copyPublicFiles" ) ;
15
- const copyNextAssets = require ( "./lib/copyNextAssets" ) ;
16
- const setupSsrPages = require ( "./lib/setupSsrPages" ) ;
17
- const setupSsgPages = require ( "./lib/setupSsgPages" ) ;
18
- const setupHtmlPages = require ( "./lib/setupHtmlPages" ) ;
19
- const setupRedirects = require ( "./lib/setupRedirects" ) ;
12
+ const { logTitle } = require ( "./lib/helpers/ logger" ) ;
13
+ const prepareFolders = require ( "./lib/steps/ prepareFolders" ) ;
14
+ const copyPublicFiles = require ( "./lib/steps/ copyPublicFiles" ) ;
15
+ const copyNextAssets = require ( "./lib/steps/ copyNextAssets" ) ;
16
+ const setupSsrPages = require ( "./lib/steps/ setupSsrPages" ) ;
17
+ const setupSsgPages = require ( "./lib/steps/ setupSsgPages" ) ;
18
+ const setupHtmlPages = require ( "./lib/steps/ setupHtmlPages" ) ;
19
+ const setupRedirects = require ( "./lib/steps/ setupRedirects" ) ;
20
20
21
21
prepareFolders ( ) ;
22
22
You can’t perform that action at this time.
0 commit comments