From a2853c4a95d1b07ab63700db3a59235122441a4f Mon Sep 17 00:00:00 2001 From: Vivian Lim Date: Sun, 19 Jul 2020 20:03:08 -0700 Subject: [PATCH] fix non-devserver build --- frontend/preact.config.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/frontend/preact.config.js b/frontend/preact.config.js index 05528f2..55969df 100644 --- a/frontend/preact.config.js +++ b/frontend/preact.config.js @@ -30,16 +30,18 @@ export default { config.resolve.alias["react"] = "preact/compat"; config.resolve.alias["react-dom"] = "preact/compat"; - config.devServer.proxy = [{ - // proxy requests matching a pattern: - path: '/api/**', + if (config.devServer){ + config.devServer.proxy = [{ + // proxy requests matching a pattern: + path: '/api/**', - // where to proxy to: - target: 'http://localhost:8000', + // where to proxy to: + target: 'http://localhost:8000', - // optionally change Origin: and Host: headers to match target: - changeOrigin: true, - changeHost: true, - }]; + // optionally change Origin: and Host: headers to match target: + changeOrigin: true, + changeHost: true, + }]; + } } };