Files
harheimertc/nuxt.config.js

113 lines
3.9 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
devtools: { enabled: true },
modules: ['@nuxtjs/tailwindcss', '@pinia/nuxt'],
nitro: {
preset: 'node-server',
dev: process.env.NODE_ENV !== 'production'
},
// Erzwinge Dev-Port und Host zuverlässig für `npm run dev`
devServer: {
port: 3100,
host: '0.0.0.0'
},
runtimeConfig: {
// Private keys (only available on server-side)
jwtSecret: process.env.JWT_SECRET || 'local_development_secret_key_change_in_production',
encryptionKey: process.env.ENCRYPTION_KEY || 'local_development_encryption_key_change_in_production',
smtpHost: process.env.SMTP_HOST || 'smtp.gmail.com',
smtpPort: process.env.SMTP_PORT || 587,
smtpUser: process.env.SMTP_USER || 'tsschulz@tsschulz.de',
smtpPass: process.env.SMTP_PASS || '',
// Public keys (exposed to client-side)
public: {
baseUrl: process.env.NUXT_PUBLIC_BASE_URL || 'http://localhost:3100',
nodeEnv: process.env.NODE_ENV || 'development'
}
},
app: {
head: {
title: 'Harheimer TC - Tischtennis in Frankfurt-Harheim',
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{
name: 'description',
content: 'Willkommen beim Harheimer Tischtennis Club - Ihr Tischtennisverein in Frankfurt-Harheim. Mitglied werden, Training buchen, Turniere und mehr.'
},
{
name: 'keywords',
content: 'Tischtennis, Tischtennisclub, Frankfurt, Harheim, Sport, Verein, Mitgliedschaft, Pingpong'
}
],
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=Inter:wght@400;500;600;700&family=Montserrat:wght@700;800;900&display=swap'
}
]
}
},
css: ['~/assets/css/main.css'],
compatibilityDate: '2024-04-03',
hooks: {
'build:before': async () => {
const fs = await import('fs/promises')
const path = await import('path')
// Erstelle uploads Verzeichnis im public Ordner
const uploadsDir = path.join(process.cwd(), '.output', 'public', 'uploads')
try {
await fs.mkdir(uploadsDir, { recursive: true })
console.log('✅ Uploads-Verzeichnis erstellt:', uploadsDir)
} catch (error) {
console.log(' Uploads-Verzeichnis bereits vorhanden oder Fehler:', error.message)
}
// Erstelle temp Verzeichnis für LaTeX-Kompilierung
const tempDir = path.join(process.cwd(), '.output', 'temp')
try {
await fs.mkdir(tempDir, { recursive: true })
console.log('✅ Temp-Verzeichnis erstellt:', tempDir)
} catch (error) {
console.log(' Temp-Verzeichnis bereits vorhanden oder Fehler:', error.message)
}
},
'build:after': async () => {
const fs = await import('fs/promises')
const path = await import('path')
// Erstelle uploads Verzeichnis im public Ordner (nach dem Build)
const uploadsDir = path.join(process.cwd(), '.output', 'public', 'uploads')
try {
await fs.mkdir(uploadsDir, { recursive: true })
console.log('✅ Uploads-Verzeichnis nach Build erstellt:', uploadsDir)
} catch (error) {
console.log(' Uploads-Verzeichnis bereits vorhanden oder Fehler:', error.message)
}
// Erstelle temp Verzeichnis für LaTeX-Kompilierung (nach dem Build)
const tempDir = path.join(process.cwd(), '.output', 'temp')
try {
await fs.mkdir(tempDir, { recursive: true })
console.log('✅ Temp-Verzeichnis nach Build erstellt:', tempDir)
} catch (error) {
console.log(' Temp-Verzeichnis bereits vorhanden oder Fehler:', error.message)
}
}
}
})