File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env node
2
2
3
- import { join } from 'path'
3
+ import { join , resolve } from 'path'
4
4
import { spawn } from 'cross-spawn'
5
5
import { watchFile } from 'fs'
6
6
import pkg from '../../package.json'
7
+ import getConfig from '../server/config'
7
8
8
9
if ( pkg . peerDependencies ) {
9
10
Object . keys ( pkg . peerDependencies ) . forEach ( dependency => {
@@ -78,9 +79,10 @@ const startProcess = () => {
78
79
}
79
80
80
81
let proc = startProcess ( )
82
+ const { pagesDirectory = resolve ( process . cwd ( ) , 'pages' ) } = getConfig ( process . cwd ( ) )
81
83
82
84
if ( cmd === 'dev' ) {
83
- watchFile ( join ( process . cwd ( ) , 'next.config.js' ) , ( cur , prev ) => {
85
+ watchFile ( ` ${ resolve ( pagesDirectory , '..' ) } / next.config.js` , ( cur , prev ) => {
84
86
if ( cur . size > 0 || prev . size > 0 ) {
85
87
console . log ( '\n> Found a change in next.config.js, restarting the server...' )
86
88
// Don't listen to 'close' now since otherwise parent gets killed by listener
You can’t perform that action at this time.
0 commit comments