-
-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathnuxt.config.ts
More file actions
132 lines (130 loc) · 3.02 KB
/
nuxt.config.ts
File metadata and controls
132 lines (130 loc) · 3.02 KB
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
import { env } from 'std-env'
import { hash } from 'ohash'
import type { OAuthPoolToken } from '~/types'
let tokens: Partial<OAuthPoolToken>[] = env.NUXT_OAUTH_POOL ? JSON.parse(env.NUXT_OAUTH_POOL) : []
const privateTokens: Partial<OAuthPoolToken>[] = env.NUXT_OAUTH_PRIVATE_POOL ? JSON.parse(env.NUXT_OAUTH_PRIVATE_POOL) : []
export default defineNuxtConfig({
extends: ['@nuxt/ui-pro'],
modules: [
'nuxt-auth-utils',
'dayjs-nuxt',
'@nuxt/image',
'@nuxt/ui',
'@nuxtjs/fontaine',
'@nuxtjs/google-fonts',
'@vueuse/nuxt',
'@nuxtjs/seo',
(_, nuxt) => {
// seed the main tokens if there isn't a pool available
if (tokens.length === 0) {
tokens = [{
label: 'primary',
client_id: env.NUXT_OAUTH_GOOGLE_CLIENT_ID!,
client_secret: env.NUXT_OAUTH_GOOGLE_CLIENT_SECRET!,
}]
}
nuxt.options.nitro!.virtual = nuxt.options.nitro!.virtual || {}
nuxt.options.nitro.virtual['#app/token-pool.mjs']
= [
`export const tokens = ${JSON.stringify(tokens.map((t) => {
t.id = t.id || hash(t)
return t
}))}`,
`export const privateTokens = ${JSON.stringify(privateTokens.map((t) => {
t.id = t.id || hash(t)
return t
}))}`,
].join('\n')
},
],
runtimeConfig: {
key: '', // .env NUXT_KEY
session: {
cookie: {
maxAge: 60 * 60 * 24 * 90, // 3mo
},
},
postmark: {
apiKey: '', // .env NUXT_POSTMARK_API_KEY
},
public: {
features: {
keyLogin: false,
crawler: false,
},
indexing: {
usageLimitPerUser: 15,
},
},
indexing: {
maxUsersPerOAuth: 15, // we over provision slightly (25 over),
},
},
nitro: {
vercel: {
functions: {
maxDuration: 90, // second timeout for API calls
},
},
devStorage: {
app: {
base: '.db',
driver: 'fs',
},
},
storage: {
app: {
driver: 'vercelKV',
},
},
},
ui: {
icons: ['heroicons', 'simple-icons', 'ph'],
},
app: {
pageTransition: {
name: 'page',
mode: 'out-in',
},
seoMeta: {
themeColor: [
{ content: '#18181b', media: '(prefers-color-scheme: dark)' },
{ content: 'white', media: '(prefers-color-scheme: light)' },
],
},
head: {
templateParams: {
separator: '·',
},
script: [
{
'src': 'https://cdn.usefathom.com/script.js',
'data-spa': 'auto',
'data-site': 'UHBNWPCP',
'defer': true,
},
],
},
},
site: {
name: 'Request Indexing',
url: 'requestindexing.com',
},
// Fonts
fontMetrics: {
fonts: ['DM Sans'],
},
googleFonts: {
display: 'swap',
download: true,
families: {
'DM+Sans': [300, 400, 500, 600, 700],
},
},
dayjs: {
locales: ['en'],
plugins: ['relativeTime', 'utc'],
defaultLocale: 'en',
},
devtools: { enabled: true },
})