File tree 1 file changed +7
-1
lines changed
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,10 @@ export async function build() {
31
31
}
32
32
33
33
function checkRunningInsideNextjsApp ( ) {
34
- if ( ! fs . existsSync ( path . join ( appPath , "next.config.js" ) ) ) {
34
+ const extension = [ "js" , "cjs" , "mjs" ] . find ( ( ext ) =>
35
+ fs . existsSync ( path . join ( appPath , `next.config.${ ext } ` ) )
36
+ ) ;
37
+ if ( ! extension ) {
35
38
console . error ( "Error: next.config.js not found. Please make sure you are running this command inside a Next.js app." ) ;
36
39
process . exit ( 1 ) ;
37
40
}
@@ -63,6 +66,9 @@ function setStandaloneBuildMode() {
63
66
}
64
67
65
68
function buildNextjsApp ( monorepoRoot : string ) {
69
+ // note: always pass in "next.config.js" as the entrypoint.
70
+ // @vercel /next only accepts "next.config.js" as the
71
+ // entrypoint. But it doesn't actually use the file.
66
72
return nextBuild ( {
67
73
files : [ ] ,
68
74
repoRootPath : monorepoRoot ,
You can’t perform that action at this time.
0 commit comments