diff --git a/apps/web/next.config.js b/apps/web/next.config.js index 22617f42..af418237 100644 --- a/apps/web/next.config.js +++ b/apps/web/next.config.js @@ -1,18 +1,19 @@ /** @type {import("next").NextConfig} */ +const isProd = process.env.NODE_ENV === "production"; module.exports = { reactStrictMode: true, images: { // TODO: only for dev: - remotePatterns: - process.env.NODE_ENV === "development" - ? [ - { - protocol: "http", - hostname: "localhost", - port: process.env.PAYLOAD_PORT, - pathname: "/media/**", - }, - ] - : undefined, + remotePatterns: !isProd + ? [ + { + protocol: "http", + hostname: "localhost", + port: process.env.PAYLOAD_PORT, + pathname: "/media/**", + }, + ] + : undefined, }, + assetPrefix: isProd ? "https://cdn.alpha.tietokilta.fi" : undefined, };