-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnuxt.config.ts
117 lines (115 loc) · 2.23 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
import { NuxtConfig } from '@nuxt/types'
const config: NuxtConfig = {
auth: {
redirect: {
login: '/login',
logout: '/login',
home: '/',
},
strategies: {
local: {
endpoints: {
login: {
headers: {
apikey: process.env.SUPABASE_KEY,
},
method: 'POST',
params: {
grant_type: 'password',
},
url: `${process.env.SUPABASE_URL}/auth/v1/token`,
},
logout: {
headers: {
apikey: process.env.SUPABASE_KEY,
},
method: 'POST',
url: `${process.env.SUPABASE_URL}/auth/v1/logout`,
},
user: {
headers: {
apikey: process.env.SUPABASE_KEY,
},
url: `${process.env.SUPABASE_URL}/auth/v1/user`,
},
refresh: {
method: 'POST',
params: {
grant_type: 'refresh_token',
},
url: `${process.env.SUPABASE_URL}/auth/v1/token`,
},
},
user: {
property: false,
},
refreshToken: {
data: 'refresh_token',
maxAge: 60 * 60 * 24 * 30,
property: 'refresh_token',
},
scheme: 'refresh',
token: {
global: true,
maxAge: 3600,
property: 'access_token',
},
},
},
},
axios: {
baseURL: process.env.SUPABASE_URL,
headers: {
common: {
apikey: process.env.SUPABASE_KEY as string,
},
},
},
build: {
babel: {
plugins: [
[
'@babel/plugin-proposal-private-property-in-object',
{ loose: true },
],
],
}, // https://github.com/nuxt/nuxt.js/issues/9224#issuecomment-893263501
},
buildModules: [
'@nuxt/typescript-build',
'@nuxtjs/composition-api/module',
'nuxt-windicss',
'@nuxtjs/google-fonts',
'@nuxtjs/pwa',
],
components: true,
css: ['~/assets/css/main.css'],
googleFonts: {
display: 'swap',
families: {
Ubuntu: [400, 500, 700],
},
},
head: {
script: [{ src: 'https://unpkg.com/phosphor-icons' }],
},
modules: ['@nuxtjs/axios', '@nuxtjs/auth-next', '@nuxtclub/supabase'],
pwa: {
manifest: {
name: 'Bittermate',
short_name: 'Bittermate',
theme_color: '#0284C7',
},
},
router: {
middleware: 'auth',
},
srcDir: 'src',
ssr: false,
supabase: {
url: process.env.SUPABASE_URL || '',
key: process.env.SUPABASE_KEY || '',
},
target: 'static',
}
export default config