-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnuxt.config.ts
65 lines (65 loc) · 1.62 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
export default defineNuxtConfig({
sourcemap: false,
devtools: {
enabled: false,
},
// 生产环境务必指定 cookieSecret,避免密码被猜到
runtimeConfig: {
cookieName: process.env.COOKIE_NAME || 'SESSION',
cookieSecret: process.env.COOKIE_SECRET || 'secret',
cookieExpires: parseInt(process.env.COOKIE_REMEMBER_ME_EXPIRES || (60 * 60 * 24 * 1000).toString()),
},
// nitro 是由 rollup 打包的,因此不能使用 vite 才支持的 ?raw 加载 sql 文件
// 这里手动指定, dir 是相对于 /server 目录来说的
nitro: {
serverAssets: [
{
baseName: 'sql',
dir: './database/migrations/20240321135046_init',
},
],
},
// SEO相关的设置
app: {
head: {
charset: 'utf-8',
htmlAttrs: {
lang: 'zh-CN',
},
link: [
{
rel: 'shortcut icon',
href: '/favicon.svg',
},
],
meta: [
{
name: 'viewport',
content: 'width=device-width, initial-scale=1',
},
{
name: 'keywords',
content: '绝弹导航,绝弹,导航,导航网站,导航大全,导航网站大全,导航网站大全',
},
{
name: 'description',
content: '绝弹导航,绝弹,导航,导航网站,导航网站大全,导航网站大全',
},
],
},
},
// @ts-ignore
modules: ['@unocss/nuxt', 'arco-design-nuxt-module'],
// 前台使用 SSR,后台使用 CSR
routeRules: {
'/admin': {
ssr: false,
},
'/admin/*': {
ssr: false,
},
'/about': {
prerender: true,
},
},
})