-
Notifications
You must be signed in to change notification settings - Fork 0
/
nuxt.config.ts
99 lines (97 loc) · 2.12 KB
/
nuxt.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
compatibilityDate: '2024-07-20',
srcDir: 'src/',
css: ['~/assets/css/main.css'],
postcss: {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
},
devtools: {
enabled: process.env.NUXT_ENV === "development",
},
experimental: {
inlineRouteRules: true,
},
app: {
head: {
link: [
{
rel: 'icon',
type: 'image/png',
href: process.env.NUXT_ENV === "development" ? '/favicon_dev.png' : '/favicon.png',
},
],
},
},
// Github Actions no reconoce correctamente que se hará un deploy a Vercel
// por lo que se debe especificar el preset de Vercel
nitro: {
preset: 'vercel',
},
runtimeConfig: {
// Private keys, se exponen en el servidor
nuxtEnv: process.env.NUXT_ENV,
nuxtSessionName: process.env.NUXT_SESSION_NAME,
nuxtSessionPassword: process.env.NUXT_SESSION_PASSWORD,
nuxtSessionTime: process.env.NUXT_SESSION_TIME,
// Public keys, se exponen en el cliente
public: {
backendUrl: process.env.BACKEND_URL,
frontendUrl: process.env.NUXT_ENV === "development" ? process.env.FRONTEND_URL : process.env.VERCEL_URL,
mailUsername: process.env.MAIL_USERNAME,
},
session: {
name: process.env.NUXT_SESSION_NAME,
password: process.env.NUXT_SESSION_PASSWORD,
},
},
vite: {
server: {
watch: {
usePolling: true,
interval: 100,
},
},
},
components: [
{
path: '~/components',
pathPrefix: false,
},
],
modules: [
"@nuxtjs/i18n",
"@nuxt/image",
"@nuxtjs/mdc",
"nuxt-auth-utils",
"nuxt-icons",
],
i18n: {
vueI18n: './src/i18n/i18n.config.ts',
locales: [
{
code: 'en',
name: 'English',
},
{
code: 'es',
name: 'Español',
},
],
defaultLocale: 'en',
detectBrowserLanguage: {
useCookie: true,
cookieKey: 'language',
redirectOn: 'root',
alwaysRedirect: true,
},
},
// Para servir nosotros las imágenes y no depender de una API de vercel
image: {
provider: 'ipx',
domains: [(process.env.NUXT_ENV === "development" ? process.env.FRONTEND_URL : process.env.VERCEL_URL) || 'http://localhost:3000'],
},
});