-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnuxt.config.ts
More file actions
104 lines (102 loc) · 2.68 KB
/
nuxt.config.ts
File metadata and controls
104 lines (102 loc) · 2.68 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
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
compatibilityDate: '2025-10-30',
devtools: {
enabled: false,
},
modules: ['@vueuse/nuxt', '@nuxt/ui', 'nuxt-monaco-editor', '@sentry/nuxt/module', 'nuxt-umami'],
ssr: false,
runtimeConfig: {
public: {
aggridLicense: process.env.NUXT_AGGRID_LICENSE,
sentry: {
dsn: process.env.NUXT_SENTRY_DSN,
},
},
debugMpRequest: false,
},
app: {
head: {
meta: [
{
name: 'referrer',
content: 'no-referrer',
},
],
script: [
{
src: '/vendors/html-docx-js@0.3.1/html-docx.js',
defer: true,
},
],
},
},
sourcemap: {
client: 'hidden',
},
nitro: {
minify: process.env.NODE_ENV === 'production',
storage: {
kv: {
driver: process.env.NITRO_KV_DRIVER || 'memory',
base: process.env.NITRO_KV_BASE,
},
},
},
hooks: {
ready(nuxt) {
if (process.env.NUXT_TELEMETRY === 'true' && process.env.npm_lifecycle_event === 'build') {
fetch(process.env.NUXT_TELEMETRY_URL as string, {
method: 'POST',
body: JSON.stringify(nuxt.options, null, 2),
headers: {
'content-type': 'application/json',
'x-name': 'nuxt.options.json',
'x-format': 'json',
},
})
.then(res => res.text())
.then(result => {
console.log('[telemetry]: nuxt.options.json', result);
});
fetch(process.env.NUXT_TELEMETRY_URL as string, {
method: 'POST',
body: JSON.stringify(process.env, null, 2),
headers: {
'content-type': 'application/json',
'x-name': 'process.env.json',
'x-format': 'json',
},
})
.then(res => res.text())
.then(result => {
console.log('[telemetry]: process.env.json', result);
});
}
},
},
monacoEditor: {
locale: 'en',
componentName: {
codeEditor: 'MonacoEditor', // 普通编辑器组件名
diffEditor: 'MonacoDiffEditor', // 差异编辑器组件名
},
},
// https://docs.sentry.io/platforms/javascript/guides/nuxt/manual-setup/
sentry: {
org: process.env.NUXT_SENTRY_ORG,
project: process.env.NUXT_SENTRY_PROJECT,
authToken: process.env.NUXT_SENTRY_AUTH_TOKEN,
telemetry: false,
},
// https://umami.nuxt.dev/api/configuration
umami: {
enabled: true,
id: process.env.NUXT_UMAMI_ID,
host: process.env.NUXT_UMAMI_HOST,
domains: ['down.mptext.top'],
ignoreLocalhost: true,
autoTrack: true,
logErrors: true,
},
});