From 29c4035eb5ef093e415e3723e0f3e9b883864953 Mon Sep 17 00:00:00 2001 From: Tim Neutkens Date: Sun, 24 Dec 2017 19:05:23 +0100 Subject: [PATCH] Remove config from bin/next since it's unused (#3496) * No need to get the config here * Remove unused functions --- bin/next | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/bin/next b/bin/next index e189cad7..4924d4f9 100755 --- a/bin/next +++ b/bin/next @@ -1,10 +1,7 @@ #!/usr/bin/env node - -import { join, resolve } from 'path' +import { join } from 'path' import { spawn } from 'cross-spawn' -import { watchFile } from 'fs' import pkg from '../../package.json' -import getConfig from '../server/config' if (pkg.peerDependencies) { Object.keys(pkg.peerDependencies).forEach(dependency => { @@ -88,10 +85,10 @@ const startProcess = () => { } let proc = startProcess() -const { pagesDirectory = resolve(process.cwd(), 'pages') } = getConfig(process.cwd()) if (cmd === 'dev') { - watchFile(`${resolve(pagesDirectory, '..')}/next.config.js`, (cur, prev) => { + const {watchFile} = require('fs') + watchFile(`${process.cwd()}/next.config.js`, (cur, prev) => { if (cur.size > 0 || prev.size > 0) { console.log('\n> Found a change in next.config.js, restarting the server...') // Don't listen to 'close' now since otherwise parent gets killed by listener