1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00

Use correct server path since main was changed

This commit is contained in:
Tim Neutkens 2018-10-02 23:11:01 +02:00
parent d2cbabbae4
commit de6d394d73
3 changed files with 12 additions and 6 deletions

View file

@ -1,4 +1,5 @@
// This file is used for when users run `require('next-server')`
const Server = require('./dist/server/next-server').default
module.exports = function (opts) {
return new Server(opts)
module.exports = function (options) {
return new Server(options)
}

View file

@ -1,4 +1,4 @@
import Server from 'next-server'
import Server from 'next-server/dist/server/next-server'
import { join } from 'path'
import HotReloader from './hot-reloader'
import {route} from 'next-server/dist/server/router'

View file

@ -1,5 +1,10 @@
// This file is used for when users run `require('next')`
module.exports = (opts) => {
const Server = opts.dev ? require('./next-dev-server').default : require('next-server').default
return new Server(opts)
module.exports = (options) => {
if (options.dev) {
const Server = require('./next-dev-server').default
return new Server(options)
}
const next = require('next-server')
return next(options)
}