-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnuxt.config.ts
91 lines (81 loc) · 2.16 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
export default defineNuxtConfig({
app: {
// SEO config.
// https://nuxt.com/docs/api/nuxt-config#head
head: {
title: 'Nuxt 3 Starter Template',
viewport: 'width=device-width,initial-scale=1',
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
{ rel: 'icon', type: 'image/png', href: '/logo.png' },
],
meta: [
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ name: 'description', content: 'Nuxt 3 SSR & full-stack starter template, supports I18n, UnoCSS, Prisma, MySQL and provides better SEO.' },
],
},
},
// Specify a compatibility date for your app.
compatibilityDate: '2024-09-09',
// Enable early access to Nuxt v4 features or flags.
// https://nuxt.com/docs/api/nuxt-config#compatibilityversion
future: {
compatibilityVersion: 4,
},
// Enable server-side rendering.
// If you want to use SPA mode, set ssr to false, it will be built to .output/public directory.
ssr: true,
// Open devtools by default.
devtools: {
enabled: true,
},
// Server config.
devServer: {
port: 9865,
},
// Runtime config.
// https://nuxt.com/docs/api/nuxt-config#runtimeconfig-1
runtimeConfig: {
app: {
baseUrl: '',
},
public: {
requestBaseUrl: '',
},
},
// Register nuxt modules.
// https://nuxt.com/modules
modules: [
'@pinia/nuxt',
'@nuxtjs/i18n',
'@vueuse/nuxt',
'@unocss/nuxt',
'nuxt-lodash',
'@nuxt/test-utils/module',
],
// Additional auto-import config.
// https://nuxt.com/docs/api/nuxt-config#imports
imports: {
dirs: [
'constants',
'stores',
],
},
// CSS config.
// https://unocss.dev/
css: [
'@unocss/reset/tailwind.css',
],
// I18n config.
// https://i18n.nuxtjs.org/
i18n: {
defaultLocale: 'en',
// If you don't need the prefix strategy, you can remove the strategy option.
// And you can remove `useLocalePath` in `src` directory.
strategy: 'prefix_and_default',
locales: [
{ code: 'en', file: 'en.json', name: 'English' },
{ code: 'zh', file: 'zh.json', name: '中文' },
],
},
})