chore: moves next config to typescript
Also adds DOCKER_BUILD env variable in prepare for moving out from github workflows
This commit is contained in:
@@ -1,15 +0,0 @@
|
||||
const imageDomains = (process.env.IMAGE_DOMAINS ?? '').split(',').map((domain) => {
|
||||
const getDataRegex = /(?<protocol>[\w]+)?:\/\/(?<hostname>[\w.-]+)?((?<=[\d]{0,4}):(?<port>[\d]{0,4}))?\/?(?<pathname>.*)?$/
|
||||
const groups = getDataRegex.exec(domain).groups ?? {}
|
||||
return groups
|
||||
})
|
||||
|
||||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = {
|
||||
reactStrictMode: true,
|
||||
images: {
|
||||
remotePatterns: imageDomains
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = nextConfig
|
||||
@@ -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
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user