50 lines
1.4 KiB
TypeScript
50 lines
1.4 KiB
TypeScript
import { execSync } from "node:child_process"
|
|
import tailwindcss from "@tailwindcss/vite"
|
|
|
|
const getRepoVersion = () => {
|
|
try {
|
|
const tags = execSync(
|
|
"git for-each-ref --sort=-version:refname --format='%(refname:short)' refs/tags",
|
|
{ encoding: "utf8" }
|
|
)
|
|
.split("\n")
|
|
.map((tag) => tag.trim())
|
|
.filter(Boolean)
|
|
|
|
return tags[0] || "dev"
|
|
} catch {
|
|
return "dev"
|
|
}
|
|
}
|
|
|
|
// https://nuxt.com/docs/api/configuration/nuxt-config
|
|
export default defineNuxtConfig({
|
|
compatibilityDate: "2025-07-15",
|
|
devtools: { enabled: process.env.NODE_ENV !== "production" },
|
|
css: ["~/assets/css/main.css"],
|
|
app: {
|
|
head: {
|
|
link: [
|
|
{ rel: "preconnect", href: "https://fonts.googleapis.com" },
|
|
{ rel: "preconnect", href: "https://fonts.gstatic.com", crossorigin: "" },
|
|
{
|
|
rel: "stylesheet",
|
|
href: "https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&family=Outfit:wght@300;400;500;600;700;800;900&display=swap"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
runtimeConfig: {
|
|
authCookieSecure: process.env.AUTH_COOKIE_SECURE === "true",
|
|
apiSecretKey: process.env.API_SECRET_KEY,
|
|
discordBotToken: process.env.DISCORD_BOT_TOKEN,
|
|
discordChannelId: process.env.DISCORD_CHANNEL_ID,
|
|
public: {
|
|
appVersion: getRepoVersion()
|
|
}
|
|
},
|
|
vite: {
|
|
plugins: [tailwindcss()]
|
|
}
|
|
})
|