-
Notifications
You must be signed in to change notification settings - Fork 275
/
Copy pathnuxt.config.ts
159 lines (137 loc) · 3.27 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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
// SPDX-License-Identifier: AGPL-3.0-or-later
// https://nuxt.com/docs/api/configuration/nuxt-config
import type { NuxtPage } from "nuxt/schema";
import { resolve } from "path";
import applyMiddleware from "./applyMiddleware";
import head from "./head";
import locales from "./locales";
import modules from "./modules";
export default defineNuxtConfig({
app: {
head,
},
modules: modules,
ssr: false,
typescript: {
// strict: true,
// typeCheck: true,
},
devtools: {
enabled: true,
},
alias: {
"@": resolve(__dirname, "./"),
},
plugins: ["~/plugins/i18n-head.ts"],
content: {
watch: { enabled: false },
},
imports: {
dirs: ["./stores"],
},
vite: {
server: {
watch: {
usePolling: true,
ignored: [
"**/playwright/**",
"**/playwright-report/**",
"**/test/**",
"**/test-e2e/**",
"**/test-results/**",
"**/frontend/test-results/**",
"**/frontend/test-results/accessibility-results/**",
],
},
},
},
colorMode: {
classSuffix: "",
},
css: ["reduced-motion/css"],
tailwindcss: {
cssPath: "~/assets/css/tailwind.css",
configPath: "tailwind.config.ts",
},
postcss: {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
},
i18n: {
lazy: true,
strategy: "prefix_and_default",
langDir: "./i18n",
vueI18n: "./i18n.config.ts",
baseUrl: "https://activist.org",
locales,
defaultLocale: "en",
customRoutes: "config",
pages: {},
detectBrowserLanguage: {
useCookie: false,
redirectOn: "root",
},
},
components: [
{
path: "~/components",
global: true,
},
],
vue: {
compilerOptions: {
isCustomElement: (tag) =>
["swiper-slide", "swiper-container"].includes(tag),
},
},
hooks: {
"pages:extend": (pages: NuxtPage[]) => {
applyMiddleware(pages);
},
"app:resolve": (app) => {
console.log("App instance resolved:", app);
},
},
nitro: {
preset: "netlify-static",
},
security: {
// Cross-Origin Resource Sharing (CORS) not needed for frontend.
corsHandler: false,
headers: {
contentSecurityPolicy: {
"img-src": [
"'self'",
"data:",
"blob:",
import.meta.env.VITE_BACKEND_URL || "",
],
/**
* Header: "upgrade-insecure-requests" forces http requests to use https.
*
* Disabled in local dev environments to allow http requests in Safari.
* https://bugs.webkit.org/show_bug.cgi?id=250776
*
* Chromium and Firefox still allow http requests to localhost even with this header.
*/
"upgrade-insecure-requests": !(
import.meta.env.VITE_FRONTEND_URL === "http://localhost:3000"
),
},
},
rateLimiter: {
// 150 requests per minute. Local machine is not rate limited.
tokensPerInterval: 150,
interval: "minute",
whiteList: ["127.0.0.1"],
},
// When true, turns off console.log output? Also look at unplugin-remove Vite Plugin by Talljack.
removeLoggers: false,
requestSizeLimiter: {
maxUploadFileRequestInBytes: 5000000,
},
},
compatibilityDate: "2025-03-12",
});