-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathnuxt.config.ts
More file actions
112 lines (92 loc) · 2.17 KB
/
nuxt.config.ts
File metadata and controls
112 lines (92 loc) · 2.17 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
import { dirname, join } from 'path';
import { fileURLToPath } from 'url';
const currentDir = dirname(fileURLToPath(import.meta.url));
const isProd = process.env.NODE_ENV;
export default defineNuxtConfig({
devtools: { enabled: true },
runtimeConfig: {
apiEndpoint: '',
},
app: {
head: {
title: 'Nuxt 3 Template',
titleTemplate: 'Nuxt 3 Template | %s',
htmlAttrs: {
lang: 'en',
},
meta: [
{ charset: 'utf-8' },
{
hid: 'description',
name: 'description',
content: 'Highly perfomant and scalable Nuxt 3 boilerplate',
},
],
},
},
css: [join(currentDir, './assets/css/global.css')],
nitro: {
compressPublicAssets: {
gzip: true,
brotli: true,
},
minify: true,
},
modules: [
'@nuxtjs/tailwindcss',
'shadcn-nuxt',
'@pinia/nuxt',
'@nuxt/eslint',
'@unlighthouse/nuxt',
'@nuxtjs/seo',
'nuxt-security',
'@nuxt/image',
'@nuxt/icon',
],
image: {
dir: 'assets/images/',
},
shadcn: {
componentDir: './components/ui',
},
// https://nuxtseo.com/
seo: {
redirectToCanonicalSiteUrl: true,
},
// From @nuxt/seo -> @nuxt/sitemap
// https://nuxtseo.com/docs/sitemap/getting-started/introduction
sitemap: {
sources: ['/api/urls'],
},
// From @nuxt/seo -> @nuxt/robots
//https://nuxtseo.com/docs/robots/getting-started/introduction
robots: {
groups: [
{
userAgent: '*',
allow: isProd ? '/' : '',
},
],
sitemap: '/sitemap.xml',
},
// https://nuxt-security.vercel.app/documentation/headers/csp
security: {
strict: true,
nonce: true,
headers: {
contentSecurityPolicy: {
'default-src': ["'self'"],
'connect-src': ["'self'", "'nonce-{{nonce}}'", 'https://*.typicode.com'],
'style-src': ["'self'", "'unsafe-inline'"], // unsafe-inline is recommended, see docs https://nuxt-security.vercel.app/headers/csp
'img-src': ["'self'", 'data:', "'nonce-{{nonce}}'"],
'font-src': ["'self'", "'nonce-{{nonce}}'"],
'script-src': ["'self'", "'nonce-{{nonce}}'"],
'script-src-attr': ["'self'", "'nonce-{{nonce}}'"],
},
},
},
// Icons package, uses iconify convention https://iconify.design/docs/icons/icon-basics.html
icon: {
componentName: 'NuxtIcon',
},
});