-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathnuxt.config.ts
More file actions
130 lines (124 loc) · 3.57 KB
/
nuxt.config.ts
File metadata and controls
130 lines (124 loc) · 3.57 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
import topLevelAwait from "vite-plugin-top-level-await";
import wasm from "vite-plugin-wasm";
import type { LocaleObject } from "@nuxtjs/i18n";
const defaultLocale = "en";
const locales: LocaleObject[] = [
{ code: "en", dir: "ltr", language: "en-US", file: "en.json" },
{ code: "es", dir: "ltr", language: "es-ES", file: "es.json" },
{ code: "fr", dir: "ltr", language: "fr-FR", file: "fr.json" },
{ code: "de", dir: "ltr", language: "de-DE", file: "de.json" },
{ code: "he", dir: "rtl", language: "he-IL", file: "he.json" },
{ code: "zh", dir: "ltr", language: "zh-CN", file: "zh.json" },
{ code: "ja", dir: "ltr", language: "ja-JP", file: "ja.json" },
];
const isDev = process.env.NODE_ENV === "development";
const apiBaseUrl = import.meta.env.NUXT_PUBLIC_API_BASE_URL;
const platform: string = import.meta.env.TAURI_ENV_PLATFORM;
// const internalHost = import.meta.env.TAURI_DEV_HOST || "localhost";
const githubOauthEnabled =
!!import.meta.env.NUXT_OAUTH_GITHUB_CLIENT_ID &&
!!import.meta.env.NUXT_OAUTH_GITHUB_CLIENT_SECRET &&
!!import.meta.env.NUXT_OAUTH_GITHUB_REDIRECT_URL;
const siteUrl = platform ? "http://tauri.localhost" : isDev ? "http://localhost:3000" : apiBaseUrl;
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
modules: [
"@nuxthub/core",
"@nuxt/eslint",
"@nuxt/fonts",
"@nuxtjs/i18n",
"@nuxtjs/color-mode",
"@vueuse/nuxt",
"@unocss/nuxt",
"reka-ui/nuxt",
],
devtools: {
enabled: !platform,
timeline: { enabled: true },
},
app: {
layoutTransition: { name: "conjure" },
head: {
templateParams: { separator: "•" },
meta: [
{
name: "viewport",
content: "width=device-width, minimum-scale=1.0, maximum-scale=1.0, viewport-fit=cover",
},
],
},
},
css: ["@unocss/reset/tailwind.css", "@/assets/scss/main.scss"],
vue: { compilerOptions: { isCustomElement: (tag) => tag.startsWith("md-") } },
runtimeConfig: {
public: {
apiBaseUrl: "",
platform,
githubOauthEnabled,
},
session: {
password: "",
},
oauth: {
github: {
clientId: "",
clientSecret: "",
redirectURL: "",
},
},
polar: {
accessToken: "",
webhookSecret: "",
},
},
sourcemap: true,
experimental: {
typedPages: true,
viewTransition: true,
asyncContext: true,
},
compatibilityDate: "2026-03-14",
// future: { compatibilityVersion: 5 },
nitro: {
preset: "cloudflare-durable",
cloudflare: { deployConfig: true },
esbuild: { options: { target: "esnext" } },
prerender: {
routes: ["/", "/calendar", "/space"],
crawlLinks: true,
},
experimental: { websocket: true, wasm: true },
},
hub: {
db: { dialect: "sqlite", driver: "d1", applyMigrationsDuringBuild: false },
kv: { driver: "cloudflare-kv-binding", binding: "KV" },
cache: { driver: "cloudflare-kv-binding", binding: "CACHE" },
blob: { driver: "cloudflare-r2", binding: "BLOB" },
},
vite: {
plugins: [topLevelAwait(), wasm()],
},
eslint: {
config: {
nuxt: { sortConfigKeys: true },
import: false,
typescript: true,
tooling: true,
stylistic: false,
},
},
fonts: {
families: [
{ name: "Maple Mono", provider: "local", global: true },
{ name: "Maple Mono CN", provider: "local", global: true },
{ name: "New CM Math", provider: "local", global: true },
],
},
i18n: {
locales,
defaultLocale,
langDir: "locales",
strategy: "no_prefix",
baseUrl: siteUrl,
},
});