From c8a348ed0fe33d3736d8e42a5e8206368f2304c3 Mon Sep 17 00:00:00 2001 From: thatmattlove Date: Fri, 31 May 2024 22:56:26 -0400 Subject: [PATCH] fix invalid next.config.js options --- hyperglass/ui/next.config.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hyperglass/ui/next.config.js b/hyperglass/ui/next.config.js index 8e95395..0c259b9 100644 --- a/hyperglass/ui/next.config.js +++ b/hyperglass/ui/next.config.js @@ -9,11 +9,14 @@ const nextConfig = { }, swcMinify: true, productionBrowserSourceMaps: true, - output: 'export', }; +if (process.env.NODE_ENV === 'production') { + nextConfig.output = 'export'; +} + if (process.env.NODE_ENV === 'development') { - nextConfig.rewrites = [ + nextConfig.rewrites = async () => [ { source: '/api/query', destination: `${process.env.HYPERGLASS_URL}api/query` }, { source: '/images/:image*', destination: `${process.env.HYPERGLASS_URL}images/:image*` }, ];