From 596ae27185e1e22651f9fc0e6b6d51b8e27f6dd5 Mon Sep 17 00:00:00 2001 From: Leo Lamprecht Date: Mon, 12 Nov 2018 19:29:36 +0100 Subject: [PATCH] Deprecate support for `now.json` and `package.json` (#489) * Removed now.json from readme * Emit warning message if using now.json or package.json --- README.md | 2 +- bin/serve.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ab867e3a..040fef2d 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ Now you understand how the package works! :tada: ## Configuration -To customize `serve`'s behavior, create a `serve.json` file and insert any of [these properties](https://github.com/zeit/serve-handler#options). In addition, `serve` will also detect `now.json` files if they contain the `static` property. +To customize `serve`'s behavior, create a `serve.json` file and insert any of [these properties](https://github.com/zeit/serve-handler#options). ## API diff --git a/bin/serve.js b/bin/serve.js index 5147cf0a..665389a5 100755 --- a/bin/serve.js +++ b/bin/serve.js @@ -284,6 +284,10 @@ const loadConfig = async (cwd, entry, args) => { Object.assign(config, content); console.log(info(`Discovered configuration in \`${file}\``)); + if (file === 'now.json' || file === 'package.json') { + console.error(warning('The config files `now.json` and `package.json` are deprecated. Please use `serve.json`.')); + } + break; }