-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnuxt.config.ts
97 lines (89 loc) · 2.34 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
// https://nuxt.com/docs/api/configuration/nuxt-config
import vuetify, { transformAssetUrls } from "vite-plugin-vuetify";
export default defineNuxtConfig({
plugins: [
process.env.NODE_ENV !== "development"
? "plugins/production/vue-matomo.client.js"
: "",
process.env.NODE_ENV !== "development"
? "plugins/production/cloudflare.client.js"
: "",
].filter(Boolean),
devtools: { enabled: true },
build: {
transpile: ["vuetify"],
},
modules: [
"@nuxt/eslint",
"nuxt-security",
"@nuxt/devtools",
"@nuxtjs/seo",
(_options, nuxt) => {
nuxt.hooks.hook("vite:extendConfig", (config) => {
config.plugins.push(vuetify({ autoImport: true }));
});
},
],
routeRules: {
"/*": {
headers: {
"Access-Control-Allow-Origin": [
"https://hthompson.dev",
"https://*.hthompson.dev",
],
},
},
},
security: {
enabled: true,
strict: true,
nonce: true,
corsHandler: false,
//corsHandler: {
// origin: ["https://hthompson.dev", "https://*.hthompson.dev"],
//},
allowedMethodsRestricter: {
methods: ["GET", "HEAD", "OPTIONS"],
},
headers: {
crossOriginEmbedderPolicy:
process.env.NODE_ENV === "development" ? "unsafe-none" : "require-corp",
contentSecurityPolicy: {
"default-src": ["'self'"],
"img-src": ["'self'", "blob:"],
"style-src": ["'self'", "https:", "'unsafe-inline'"],
"connect-src": ["'self'", "https://analytics.hthompson.dev"],
"script-src": [
"'self'",
"https:",
"'unsafe-inline'",
"'strict-dynamic'",
"'nonce-{{nonce}}'",
"https://analytics.hthompson.dev",
"https://files.hthompson.dev/scripts/tracking.js",
"https://static.cloudflareinsights.com",
],
},
referrerPolicy: "same-origin",
strictTransportSecurity: {
maxAge: 31536000,
includeSubdomains: true,
preload: true,
},
xContentTypeOptions: "nosniff",
xFrameOptions: "SAMEORIGIN",
xXSSProtection: "1; mode=block",
},
hidePoweredBy: true,
},
vite: {
vue: {
template: {
transformAssetUrls,
},
},
},
css: ["~/assets/css/main.css"],
telemetry: false,
compatibilityDate: "2024-10-19",
});