-
Notifications
You must be signed in to change notification settings - Fork 0
/
nuxt.config.ts
77 lines (75 loc) · 1.65 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
import './env'
import { defineNuxtModule, addTemplate } from '@nuxt/kit'
// outputs tailwind.config.cjs so that tailwindcss intellisense works
const tailwindConfigModule = defineNuxtModule({
setup (_, nuxt) {
nuxt.hook('tailwindcss:resolvedConfig', (config) => {
addTemplate({
filename: 'tailwind.config.cjs', // gets prepended by .nuxt/
getContents: () => `module.exports = ${JSON.stringify(config)}`,
write: true
})
})
}
})
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
modules: [
tailwindConfigModule,
'@sidebase/nuxt-auth',
'@nuxtjs/tailwindcss',
'@huntersofbook/naive-ui-nuxt',
'nuxt-security'
],
nitro: {
preset: 'vercel'
},
build: {
transpile: ['trpc-nuxt']
},
typescript: {
shim: false
},
security: {
basicAuth: false,
csrf: false,
hidePoweredBy: true,
rateLimiter: {
tokensPerInterval: 300,
interval: 'minute'
},
headers: {
contentSecurityPolicy: {
'img-src': ['self', 'https:', 'data:']
},
crossOriginResourcePolicy: 'cross-origin',
crossOriginEmbedderPolicy: 'unsafe-none'
}
},
routeRules: {
'/api/auth/signin': {
security: {
rateLimiter: {
tokensPerInterval: 6,
interval: 'minute'
}
}
},
'/api/auth/signup': {
security: {
rateLimiter: {
tokensPerInterval: 6,
interval: 'minute'
}
}
},
'/api/auth/signin/*': {
security: {
rateLimiter: {
tokensPerInterval: 6,
interval: 'minute'
}
}
}
}
})