File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 7070 "cross-spawn" : " 5.1.0" ,
7171 "del" : " 3.0.0" ,
7272 "etag" : " 1.8.1" ,
73+ "find-up" : " 2.1.0" ,
7374 "fresh" : " 0.5.2" ,
7475 "friendly-errors-webpack-plugin" : " 1.6.1" ,
7576 "glob" : " 7.1.2" ,
Original file line number Diff line number Diff line change 1- import { join } from 'path'
2- import { existsSync } from 'fs'
1+ import findUp from 'find-up'
32
43const cache = new Map ( )
54
@@ -26,12 +25,13 @@ function loadConfig (dir, customConfig) {
2625 customConfig . configOrigin = 'server'
2726 return withDefaults ( customConfig )
2827 }
29- const path = join ( dir , 'next.config.js' )
28+ const path = findUp . sync ( 'next.config.js' , {
29+ cwd : dir
30+ } )
3031
3132 let userConfig = { }
3233
33- const userHasConfig = existsSync ( path )
34- if ( userHasConfig ) {
34+ if ( path && path . length ) {
3535 const userConfigModule = require ( path )
3636 userConfig = userConfigModule . default || userConfigModule
3737 userConfig . configOrigin = 'next.config.js'
You can’t perform that action at this time.
0 commit comments