1
1
const { normalize } = require ( 'path' )
2
- const debounceFn = require ( 'debounce-fn' )
2
+
3
3
const chokidar = require ( 'chokidar' )
4
+ const debounceFn = require ( 'debounce-fn' )
4
5
const execa = require ( 'execa' )
5
6
7
+ const { NETLIFY_PUBLISH_PATH , NETLIFY_FUNCTIONS_PATH , SRC_FILES } = require ( './lib/config' )
6
8
const { logTitle } = require ( './lib/helpers/logger' )
7
-
8
- const prepareFolders = require ( './lib/steps/prepareFolders' )
9
- const copyPublicFiles = require ( './lib/steps/copyPublicFiles' )
10
9
const copyNextAssets = require ( './lib/steps/copyNextAssets' )
11
- const setupPages = require ( './lib/steps/setupPages' )
10
+ const copyPublicFiles = require ( './lib/steps/copyPublicFiles' )
11
+ const prepareFolders = require ( './lib/steps/prepareFolders' )
12
+ const setupHeaders = require ( './lib/steps/setupHeaders' )
12
13
const setupImageFunction = require ( './lib/steps/setupImageFunction' )
14
+ const setupPages = require ( './lib/steps/setupPages' )
13
15
const setupRedirects = require ( './lib/steps/setupRedirects' )
14
- const setupHeaders = require ( './lib/steps/setupHeaders' )
15
- const { NETLIFY_PUBLISH_PATH , NETLIFY_FUNCTIONS_PATH , SRC_FILES } = require ( './lib/config' )
16
16
17
17
const build = async ( functionsPath , publishPath ) => {
18
18
const trackNextOnNetlifyFiles = prepareFolders ( {
@@ -45,8 +45,8 @@ const watch = (functionsPath, publishPath) => {
45
45
try {
46
46
execa . sync ( 'next' , [ 'build' ] , { stdio : 'inherit' } )
47
47
await build ( functionsPath , publishPath )
48
- } catch ( e ) {
49
- console . log ( e )
48
+ } catch ( error ) {
49
+ console . log ( error )
50
50
}
51
51
} ,
52
52
{
@@ -57,13 +57,13 @@ const watch = (functionsPath, publishPath) => {
57
57
chokidar . watch ( SRC_FILES ) . on ( 'all' , runBuild )
58
58
}
59
59
60
- /** options param:
61
- * {
62
- * functionsDir: string to path
63
- * publishDir: string to path
64
- * watch: { directory: string to path }
65
- * }
66
- * /
60
+ // options param:
61
+ // {
62
+ // functionsDir: string to path
63
+ // publishDir: string to path
64
+ // watch: { directory: string to path }
65
+ // }
66
+ / /
67
67
68
68
const nextOnNetlify = async ( options = { } ) => {
69
69
const functionsPath = normalize ( options . functionsDir || NETLIFY_FUNCTIONS_PATH )
0 commit comments