-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnuxt.config.ts
133 lines (131 loc) · 3.49 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
import { readFileSync } from 'fs'
import path from 'path'
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
runtimeConfig: {
public: {
gqlHost: process.env.GQL_HOST || '',
},
},
app: {
head: {
title: 'Wireguard Manager',
meta: [
{
name: 'theme-color',
content: '#88c0d0',
},
],
link: [
{
rel: 'icon',
href: '/favicon.svg',
type: 'image/svg+xml',
},
],
},
},
plugins: [
'~/plugins/dev.ts',
'~/plugins/dark',
'~/plugins/zod',
'~/plugins/gql',
'~/plugins/auth/index.ts',
'~/plugins/charts.ts',
].filter(Boolean),
modules: [
'@vueuse/nuxt',
'nuxt-quasar-ui',
'@nuxtjs/apollo',
'@unocss/nuxt',
'@pinia/nuxt',
],
components: {
dirs: ['~/components', '~/components/entities'],
},
pinia: {
autoImports: ['defineStore', 'acceptHMRUpdate'],
},
apollo: {
clients: {
default: {
// this is not actually used, but required by the plugin
// use the runtime config instead
httpEndpoint: 'IGNORE_THIS',
},
},
tokenStorage: 'localStorage',
},
quasar: {
// string[]: https://quasar.dev/quasar-plugins
plugins: ['Dialog', 'Notify'],
// boolean | string: Truthy values requires `sass@1.32.12`, same behaviour as `@quasar/vite-plugin`
sassVariables: './quasar.scss',
// Requires `@quasar/extras` package
extras: {
// string | null: Auto-import roboto font. https://quasar.dev/style/typography#default-font
font: 'roboto-font',
// string[]: Auto-import webfont icons. Usage: https://quasar.dev/vue-components/icon#webfont-usage
fontIcons: ['material-icons'],
// string[]: Auto-import svg icon collections. Usage: https://quasar.dev/vue-components/icon#svg-usage
// svgIcons: [],
// string[]: Auto-import animations from 'animate.css'. Usage: https://quasar.dev/options/animations#usage
// animations: [],
},
},
unocss: {
shortcuts: {
'app-link': 'text-secondary no-underline hover:underline',
},
rules: [
[
/^grid-(fit|fill)(\S+)?/,
([, type, v]) => {
const [v1 = 'min-content', v2 = '1fr'] = v
.replace(/^-/, '')
.split('_')
.filter(Boolean)
.map((e) => (!e || /\D/.test(e) ? e : `${+e / 4}rem`))
return {
'grid-template-columns': `repeat(auto-${type}, minmax(${v1}, ${v2}) )`,
}
},
],
],
theme: {
colors: {
primary: 'hsl(var(--c-primary))',
secondary: 'hsl(var(--c-secondary))',
accent: 'hsl(var(--c-accent))',
// used by dark mode
'dark-page': 'hsl(var(--c-dark-page))',
dark: 'hsl(var(--c-dark))',
positive: 'hsl(var(--c-positive))',
negative: 'hsl(var(--c-negative))',
info: 'hsl(var(--c-info))',
warning: 'hsl(var(--c-warning))',
},
},
preprocess(matcher) {
const PREFIX = '-'
if (matcher.startsWith('i-')) return matcher
return matcher.startsWith(PREFIX)
? matcher.slice(PREFIX.length)
: undefined
},
icons: {
extraProperties: {
display: 'inline-block',
'vertical-align': 'middle',
},
collections: {
app: {
wireguard: readFileSync(
path.resolve(__dirname, 'public/favicon.svg')
).toString(),
},
},
},
},
ssr: false,
})