提交 cdbbe928 编写于 作者: T Tim Neutkens 提交者: Arunoda Susiripala

Add update notifier (#3678)

* Add update notifier

* Make update notifier work with custom server
上级 9498fc60
......@@ -50,6 +50,7 @@
"bin/*": "standard"
},
"dependencies": {
"@zeit/check-updates": "1.1.0",
"@zeit/source-map-support": "0.6.2",
"ansi-html": "0.0.7",
"babel-core": "6.26.0",
......
......@@ -5,6 +5,7 @@ import { parse as parseQs } from 'querystring'
import fs from 'fs'
import fsAsync from 'mz/fs'
import http, { STATUS_CODES } from 'http'
import updateNotifier from '@zeit/check-updates'
import {
renderToHTML,
renderErrorToHTML,
......@@ -35,6 +36,11 @@ export default class Server {
this.http = null
this.config = getConfig(this.dir, conf)
this.dist = this.config.distDir
if (dev) {
updateNotifier(pkg, 'next')
}
if (!dev && !fs.existsSync(resolve(dir, this.dist, 'BUILD_ID'))) {
console.error(`> Could not find a valid build in the '${this.dist}' directory! Try building your app with 'next build' before starting the server.`)
process.exit(1)
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册