-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnuxt.config.ts
More file actions
62 lines (54 loc) · 1.49 KB
/
nuxt.config.ts
File metadata and controls
62 lines (54 loc) · 1.49 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
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
ssr: false, // SPA 模式
future: { compatibilityVersion: 4 },
modules: [
'@pinia/nuxt',
'@vueuse/nuxt',
'@nuxt/eslint',
],
imports: {
dirs: ['composables/**'],
},
css: [
'katex/dist/katex.min.css',
],
app: {
head: {
title: 'Leverage OJ',
meta: [
{ charset: 'utf-8' },
{ name: 'description', content: '在线评测系统' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ name: 'theme-color', content: '#18a058' },
{ name: 'mobile-web-app-capable', content: 'yes' },
{ name: 'apple-mobile-web-app-capable', content: 'yes' },
{ name: 'apple-mobile-web-app-status-bar-style', content: 'default' },
{ name: 'apple-mobile-web-app-title', content: 'LevOJ' },
],
link: [
{ rel: 'manifest', href: '/manifest.json' },
{ rel: 'apple-touch-icon', href: '/icon-192.png' },
],
},
},
runtimeConfig: {
public: {
apiBase: process.env.NUXT_PUBLIC_API_BASE || '/api',
},
},
// 开发模式:将 /api/* 代理到后端,与生产 Nginx 行为一致
vite: {
server: {
proxy: {
'/api': {
target: 'http://localhost:3000',
rewrite: (path: string) => path.replace(/^\/api/, ''),
changeOrigin: true,
},
},
},
},
compatibilityDate: '2024-11-01',
devtools: { enabled: true },
})