From d8a4972feaaf84d4117add465e6347358528533c Mon Sep 17 00:00:00 2001 From: Raees Iqbal Date: Mon, 13 Apr 2020 05:57:30 -0700 Subject: [PATCH] Revert "Dev: Dont crash on no config file (#820)" This reverts commit 647aee8d7ff1498c01d38d51c7710408e17d3761. --- src/utils/rules-proxy.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/utils/rules-proxy.js b/src/utils/rules-proxy.js index d12a9af9615..6a81e95ad18 100644 --- a/src/utils/rules-proxy.js +++ b/src/utils/rules-proxy.js @@ -57,15 +57,11 @@ function getCountry(req) { module.exports = function createRewriter({ distDir, projectDir, jwtSecret, jwtRole, configPath }) { let matcher = null - const configFiles = Array.from( - new Set( - [ - path.resolve(distDir, '_redirects'), - path.resolve(projectDir, '_redirects'), - ] - .concat(configPath ? path.resolve(configPath) : []) - ) - ).filter(f => f !== projectDir && fs.existsSync(f)) + const configFiles = Array.from(new Set([ + path.resolve(configPath), + path.resolve(distDir, '_redirects'), + path.resolve(projectDir, '_redirects'), + ])).filter(f => fs.existsSync(f)) let rules = [] onChanges(configFiles, async () => {