Some checks failed
Auto Tag Develop / tag (push) Failing after 7s
Same versioning system as SIRH/Lesstime. Updates nuxt.config.ts, Dockerfile, deploy.sh, auto-tag CI, and release script. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
84 lines
2.4 KiB
TypeScript
84 lines
2.4 KiB
TypeScript
import tailwindcss from '@tailwindcss/vite'
|
|
import { readFileSync } from 'node:fs'
|
|
import { dirname, resolve } from 'node:path'
|
|
import { fileURLToPath } from 'node:url'
|
|
|
|
// Lire la version depuis config/version.yaml à la racine du projet parent
|
|
const getAppVersion = (): string => {
|
|
try {
|
|
const __dirname = dirname(fileURLToPath(import.meta.url))
|
|
const versionPath = resolve(__dirname, '..', 'config', 'version.yaml')
|
|
const content = readFileSync(versionPath, 'utf-8')
|
|
const match = content.match(/app\.version:\s*'([^']+)'/)
|
|
return match ? match[1] : '0.0.0'
|
|
} catch {
|
|
return '0.0.0'
|
|
}
|
|
}
|
|
|
|
const appVersion = process.env.NUXT_PUBLIC_APP_VERSION || getAppVersion()
|
|
|
|
export default defineNuxtConfig({
|
|
compatibilityDate: '2025-07-15',
|
|
components: {
|
|
dirs: [
|
|
{ path: '~/components', pathPrefix: false },
|
|
],
|
|
},
|
|
ssr: false, // Désactive le SSR pour un mode SPA pur (Client-Side Rendering uniquement)
|
|
devtools: { enabled: true },
|
|
devServer: {
|
|
host: '0.0.0.0',
|
|
port: 3000
|
|
},
|
|
modules: [
|
|
[
|
|
'unplugin-icons/nuxt',
|
|
{
|
|
componentPrefix: 'Icon',
|
|
warn: process.env.NODE_ENV === 'development',
|
|
collections: {
|
|
lucide: () => import('@iconify-json/lucide/icons.json').then(i => i.default)
|
|
}
|
|
}
|
|
]
|
|
],
|
|
runtimeConfig: {
|
|
apiBaseUrl: process.env.NUXT_API_BASE_URL
|
|
|| process.env.NUXT_PUBLIC_API_BASE_URL
|
|
|| 'http://localhost/api',
|
|
public: {
|
|
apiBaseUrl: process.env.NUXT_PUBLIC_API_BASE_URL || '/api',
|
|
appUrl: process.env.NUXT_PUBLIC_APP_URL || 'http://localhost:3001',
|
|
appName: process.env.NUXT_PUBLIC_APP_NAME || 'Inventory Management System',
|
|
appVersion: appVersion,
|
|
apiTimeout: process.env.NUXT_PUBLIC_API_TIMEOUT || '30000',
|
|
requestTimeout: process.env.NUXT_PUBLIC_REQUEST_TIMEOUT || '10000',
|
|
enableDebug: process.env.NUXT_PUBLIC_ENABLE_DEBUG || 'false',
|
|
enableAnalytics: process.env.NUXT_PUBLIC_ENABLE_ANALYTICS || 'false',
|
|
csrfToken: process.env.NUXT_PUBLIC_CSRF_TOKEN || '',
|
|
logLevel: process.env.NUXT_PUBLIC_LOG_LEVEL || 'warn'
|
|
}
|
|
},
|
|
vite: {
|
|
plugins: [tailwindcss()],
|
|
server: {
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://localhost',
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
css: ['~/assets/app.css'],
|
|
router: {
|
|
options: {
|
|
strict: false
|
|
}
|
|
},
|
|
experimental: {
|
|
payloadExtraction: false
|
|
}
|
|
})
|