-
Notifications
You must be signed in to change notification settings - Fork 0
/
nuxt.config.ts
154 lines (147 loc) · 3.56 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
modules: [
'@hebilicious/authjs-nuxt',
'@nuxt/devtools',
'@vueuse/nuxt',
'@nuxt/ui',
'@nuxt/image',
'@vue-macros/nuxt',
'nuxt-time',
'@nuxt/test-utils/module',
'@nuxtjs/seo',
'@vite-pwa/nuxt',
'@nuxt/fonts',
'@nuxt/eslint',
],
eslint: {
config: {
standalone: false,
},
},
build: {
transpile: ['trpc-nuxt'],
},
tailwindcss: {
cssPath: '~/assets/global.css',
},
devtools: { enabled: true },
app: {
pageTransition: { name: 'page', mode: 'out-in' },
},
sourcemap: {
server: false,
},
authJs: {
verifyClientOnEveryRequest: true,
guestRedirectTo: '/auth/sign-in',
baseUrl: process.env.AUTH_ORIGIN,
},
runtimeConfig: {
authJs: {
secret: process.env.NEXTAUTH_SECRET, // You can generate one with `openssl rand -base64 32`
},
discord: {
clientId: process.env.DISCORD_CLIENT_ID,
clientSecret: process.env.DISCORD_CLIENT_SECRET,
adminUserId: process.env.DISCORD_ADMIN_USER_ID,
},
public: {
authJs: {
baseUrl: process.env.AUTH_ORIGIN, // The base URL is used for the Origin Check in prod only
verifyClientOnEveryRequest: true, // whether to hit the /auth/session endpoint on every client request
guestRedirectTo: '/auth/sign-in',
},
cloudinaryFolder: process.env.CLOUDINARY_FOLDER,
},
discordWebhook: process.env.DISCORD_WEBHOOK,
},
alias: {
cookie: 'cookie',
},
experimental: {
payloadExtraction: true,
componentIslands: true,
appManifest: true,
},
image: {
domains: ['cdn.discordapp.com', 'res.cloudinary.com'],
cloudinary: {
baseURL: `https://res.cloudinary.com/${process.env.CLOUDINARY_CLOUD_NAME}/image/upload/`,
},
},
site: {
name: 'Memespeak Predictor',
url: process.env.AUTH_ORIGIN,
},
colorMode: {
preference: 'system',
fallback: 'dark',
},
sitemap: {
sources: ['/api/__sitemap__/urls'],
cacheMaxAgeSeconds: 3600,
},
ogImage: {
enabled: process.env.NODE_ENV === 'production',
fonts: ['Exo:400', 'Exo:700'],
defaults: {
cacheMaxAgeSeconds: 60 * 60 * 24 * 7 * 1000, // 7 days
},
googleFontMirror: true,
},
nitro: {
storage: {
cache: {
driver: 'cloudflare-kv-binding',
binding: 'CACHE',
},
},
},
pwa: {
strategies: 'generateSW',
registerType: 'autoUpdate',
manifest: {
name: 'Memespeak Predictor',
short_name: 'Memespeak Predictor',
theme_color: '#212121',
icons: [
{
src: 'pwa-192x192.png',
sizes: '192x192',
type: 'image/png',
},
{
src: 'pwa-512x512.png',
sizes: '512x512',
type: 'image/png',
},
{
src: 'pwa-512x512-maskable.png',
sizes: '512x512',
type: 'image/png',
purpose: 'any maskable',
},
],
},
workbox: {
globPatterns: ['**/*.{js,css,html,png,svg,ico}'],
},
injectManifest: {
globPatterns: ['**/*.{js,css,html,png,svg,ico}'],
},
client: {
installPrompt: true,
// you don't need to include this: only for testing purposes
// if enabling periodic sync for update use 1 hour or so (periodicSyncForUpdates: 3600)
periodicSyncForUpdates: 20,
},
devOptions: {
enabled: false,
suppressWarnings: true,
navigateFallback: '/',
navigateFallbackAllowlist: [/^\/$/],
type: 'module',
},
},
})