-
Notifications
You must be signed in to change notification settings - Fork 13
/
nuxt.config.js
150 lines (149 loc) · 3.98 KB
/
nuxt.config.js
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
import * as SITE_INFO from './content/site/info.json'
import { COLOR_MODE_FALLBACK } from './utils/globals.js'
export default defineNuxtConfig({
target: 'static',
generate: {
fallback: true
},
// ? The env/runtimeConfig Property: https://v3.nuxtjs.org/guide/features/runtime-config/
runtimeConfig: {
// The private keys which are only available within server-side. DON’T PUBLISH SECRETS IN CLEAR TEXT TO GIT. Use environment variables instead.
apiSecret: '123',
// Keys within public, will be also exposed to the client-side
public: {
url:
process.env.NODE_ENV === 'production'
? process.env.URL || 'http://createADotEnvFileAndSetURL'
: 'http://localhost:3000',
lang: SITE_INFO.sitelang || 'en-US'
}
},
/*
** Headers of the page
*/
head: {
title: SITE_INFO.sitename || process.env.npm_package_name || '',
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{
hid: 'description',
name: 'description',
content: SITE_INFO.sitedescription || process.env.npm_package_description || ''
}
],
link: [
// { rel: 'manifest', href: '/manifest.webmanifest' },
{
rel: 'preconnect',
href: 'https://fonts.gstatic.com',
crossorigin: true
},
{
rel: 'preload',
as: 'style',
href: 'https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap'
},
{
rel: 'stylesheet',
href: 'https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap',
media: 'print',
onload: `this.media='all'`
}
], // ? Imports the font 'Inter', can be optimized by the netlify plugin 'Subfont' by uncommenting it in `netlify.toml`
noscript: [
{
innerHTML:
'<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap">'
}
],
__dangerouslyDisableSanitizers: ['noscript']
},
/*
** Customize the progress-bar color
*/
loading: { color: '#526488' },
/*
** Global CSS
*/
css: ['@/assets/css/main.pcss'],
/*
** Plugins to load before mounting the App
*/
plugins: [],
/*
** Nuxt.js modules
*/
modules: ['@nuxt/content', '@vite-pwa/nuxt', '@nuxtjs/color-mode', '@nuxtjs/tailwindcss', 'nuxt-svgo' ],
/*
** Build configuration
*/
build: {
extractCSS: true,
},
/*
** Custom additions configuration
*/
// ? The content property: https://content.nuxtjs.org/configuration
content: {
dir: 'content',
highlight: {
theme: {
default: 'github-light',
dark: 'github-dark',
}
}
},
tailwindcss: {
viewer: true,
cssPath: '~/assets/css/main.pcss',
exposeConfig: false // enables `import { theme } from '#tailwind.config'`
},
colorMode: {
classSuffix: '',
preference: 'system', // default value of $colorMode.preference
fallback: COLOR_MODE_FALLBACK, // fallback value if not system preference found
componentName: 'ColorScheme',
cookie: {
options: {
sameSite: 'lax'
}
}
},
pwa: {
manifest: {
name: SITE_INFO.sitename || process.env.npm_package_name || '',
lang: process.env.lang,
icons: [
{
src: 'pwa-64x64.png',
sizes: '64x64',
type: 'image/png',
},
{
src: 'pwa-192x192.png',
sizes: '192x192',
type: 'image/png',
},
{
src: 'pwa-512x512.png',
sizes: '512x512',
type: 'image/png',
purpose: 'any',
},
{
src: 'maskable-icon-512x512.png',
sizes: '512x512',
type: 'image/png',
purpose: 'maskable',
}
],
},
meta: {
name: SITE_INFO.sitename || process.env.npm_package_name || '',
lang: process.env.lang,
ogHost: process.env.URL,
ogImage: '/preview.jpg'
}
}
});