@@ -15,7 +15,7 @@ export type Config = {
15
15
// Timestamp for when the build was started
16
16
timestamp : number ;
17
17
// Whether to skip building the Next.js app or not
18
- shouldSkip : boolean ;
18
+ skipNextBuild : boolean ;
19
19
} ;
20
20
21
21
paths : {
@@ -50,14 +50,11 @@ export type Config = {
50
50
/**
51
51
* Computes the configuration.
52
52
*
53
- * @param opts.sourceDir Next app root folder
54
- * @param opts.outputDir The directory where to save the output (defaults to the app's directory)
55
- * @param opts.skipBuild Whether the Next.js build should be skipped (i.e. if the `.next` dir is already built)
56
- *
53
+ * @param projectOpts The options for the project
57
54
* @returns The configuration, see `Config`
58
55
*/
59
- export function getConfig ( opts : ProjectOptions ) : Config {
60
- const dotNext = path . join ( opts . outputDir , ".next" ) ;
56
+ export function getConfig ( projectOpts : ProjectOptions ) : Config {
57
+ const dotNext = path . join ( projectOpts . outputDir , ".next" ) ;
61
58
const appPath = getNextjsApplicationPath ( dotNext ) . replace ( / \/ $ / , "" ) ;
62
59
const standaloneRoot = path . join ( dotNext , "standalone" ) ;
63
60
const standaloneApp = path . join ( standaloneRoot , appPath ) ;
@@ -71,12 +68,12 @@ export function getConfig(opts: ProjectOptions): Config {
71
68
return {
72
69
build : {
73
70
timestamp : Date . now ( ) ,
74
- shouldSkip : ! ! opts . skipBuild ,
71
+ skipNextBuild : ! ! projectOpts . skipBuild ,
75
72
} ,
76
73
77
74
paths : {
78
- sourceDir : opts . sourceDir ,
79
- outputDir : opts . outputDir ,
75
+ sourceDir : projectOpts . sourceDir ,
76
+ outputDir : projectOpts . outputDir ,
80
77
dotNext,
81
78
standaloneRoot,
82
79
standaloneApp,
@@ -103,8 +100,11 @@ export function containsDotNextDir(folder: string): boolean {
103
100
}
104
101
105
102
export type ProjectOptions = {
103
+ // Next app root folder
106
104
sourceDir : string ;
105
+ // The directory to save the output to (defaults to the app's directory)
107
106
outputDir : string ;
107
+ // Whether the Next.js build should be skipped (i.e. if the `.next` dir is already built)
108
108
skipBuild ?: boolean ;
109
109
} ;
110
110
0 commit comments