82 lines
1.8 KiB
TypeScript
82 lines
1.8 KiB
TypeScript
// Nuxt 3 + Quasar + Tailwind + TypeScript
|
|
// Configuration for E-Learning Platform
|
|
export default defineNuxtConfig({
|
|
compatibilityDate: '2026-01-19',
|
|
|
|
modules: [
|
|
'nuxt-quasar-ui',
|
|
'@nuxtjs/tailwindcss',
|
|
'@nuxtjs/i18n'
|
|
],
|
|
|
|
i18n: {
|
|
strategy: 'no_prefix',
|
|
defaultLocale: 'th',
|
|
|
|
// ✅ สำคัญ: ไม่ใส่ i18n/ ซ้ำ (ฐานคือโฟลเดอร์ i18n อยู่แล้ว)
|
|
langDir: 'locales',
|
|
lazy: true,
|
|
|
|
locales: [
|
|
{ code: 'th', iso: 'th-TH', name: 'ไทย', file: 'th.json' },
|
|
{ code: 'en', iso: 'en-US', name: 'English', file: 'en.json' }
|
|
],
|
|
|
|
// ✅ ให้ใช้ config จากไฟล์นี้ด้วย (ถ้าคุณมี i18n.config.ts)
|
|
vueI18n: './i18n.config.ts',
|
|
|
|
detectBrowserLanguage: {
|
|
useCookie: true,
|
|
cookieKey: 'i18n_redirected',
|
|
redirectOn: 'root'
|
|
}
|
|
},
|
|
|
|
css: ['~/assets/css/main.css'],
|
|
|
|
typescript: {
|
|
strict: true
|
|
},
|
|
|
|
quasar: {
|
|
plugins: ['Notify'],
|
|
config: {
|
|
brand: {
|
|
primary: '#4b82f7',
|
|
secondary: '#2f5ed7',
|
|
accent: '#44d4a8',
|
|
dark: '#0f1827'
|
|
}
|
|
}
|
|
},
|
|
|
|
components: [
|
|
{
|
|
path: '~/components',
|
|
pathPrefix: false
|
|
}
|
|
],
|
|
|
|
app: {
|
|
head: {
|
|
htmlAttrs: {
|
|
lang: 'th'
|
|
},
|
|
title: 'E-Learning System',
|
|
meta: [{ name: 'viewport', content: 'width=device-width, initial-scale=1' }],
|
|
link: [
|
|
{
|
|
rel: 'stylesheet',
|
|
href:
|
|
'https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Prompt:wght@300;400;500;600;700;800;900&family=Sarabun:wght@300;400;500;600;700;800&display=swap'
|
|
}
|
|
]
|
|
}
|
|
},
|
|
|
|
runtimeConfig: {
|
|
public: {
|
|
apiBase: process.env.NUXT_PUBLIC_API_BASE || 'http://localhost:4000/api'
|
|
}
|
|
}
|
|
})
|