From 166ac4350fb7f56ae29c497ba410a9973c737e39 Mon Sep 17 00:00:00 2001 From: SrJuggernaut Date: Thu, 2 Apr 2026 11:59:44 -0600 Subject: [PATCH] chore: moves next config to typescript Also adds DOCKER_BUILD env variable in prepare for moving out from github workflows --- next.config.js | 15 --------------- next.config.ts | 17 +++++++++++++++++ package.json | 1 - 3 files changed, 17 insertions(+), 16 deletions(-) delete mode 100644 next.config.js create mode 100644 next.config.ts diff --git a/next.config.js b/next.config.js deleted file mode 100644 index fd4b21e..0000000 --- a/next.config.js +++ /dev/null @@ -1,15 +0,0 @@ -const imageDomains = (process.env.IMAGE_DOMAINS ?? '').split(',').map((domain) => { - const getDataRegex = /(?[\w]+)?:\/\/(?[\w.-]+)?((?<=[\d]{0,4}):(?[\d]{0,4}))?\/?(?.*)?$/ - const groups = getDataRegex.exec(domain).groups ?? {} - return groups -}) - -/** @type {import('next').NextConfig} */ -const nextConfig = { - reactStrictMode: true, - images: { - remotePatterns: imageDomains - } -} - -module.exports = nextConfig diff --git a/next.config.ts b/next.config.ts new file mode 100644 index 0000000..682d82d --- /dev/null +++ b/next.config.ts @@ -0,0 +1,17 @@ +import type { NextConfig } from 'next' + +const imageDomains = (process.env.IMAGE_DOMAINS ?? '').split(',').map((domain) => { + return new URL(domain) +}) + +const IS_DOCKER_BUILD = process.env.DOCKER_BUILD === 'true' + +const nextConfig: NextConfig = { + output: IS_DOCKER_BUILD ? 'standalone' : undefined, + reactStrictMode: true, + images: { + remotePatterns: imageDomains + } +} + +module.exports = nextConfig diff --git a/package.json b/package.json index a794859..fa9a356 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,6 @@ "scripts": { "develop": "next dev", "build": "next build", - "prestart": "bun install && next build", "start": "next start", "lint": "eslint .", "prepare": "panda codegen && bun ./.husky/install.mts"