From a11d35830683ab17f96b8bf00d938e110115cb82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahlstr=C3=B6m=20Kalle?= Date: Thu, 18 Jan 2024 11:43:31 +0200 Subject: [PATCH] disable media redirect prod build --- apps/web/next.config.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/apps/web/next.config.js b/apps/web/next.config.js index 9662fa87..22617f42 100644 --- a/apps/web/next.config.js +++ b/apps/web/next.config.js @@ -3,13 +3,16 @@ module.exports = { reactStrictMode: true, images: { // TODO: only for dev: - remotePatterns: [ - { - protocol: "http", - hostname: "localhost", - port: process.env.PAYLOAD_PORT, - pathname: "/media/**", - }, - ], + remotePatterns: + process.env.NODE_ENV === "development" + ? [ + { + protocol: "http", + hostname: "localhost", + port: process.env.PAYLOAD_PORT, + pathname: "/media/**", + }, + ] + : undefined, }, };