-
Notifications
You must be signed in to change notification settings - Fork 8
/
nuxt.config.ts
93 lines (92 loc) · 2.1 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
92
93
// import { fileURLToPath } from 'node:url'
// import fs from 'fs'
import Icons from 'unplugin-icons/vite'
const prefixPath: any = process.env.VITE_NUXT_PREFIX_PATH
console.warn({
BASE_URL: process.env.VITE_NUXT_BASE_URL,
当前环境: process.env.NODE_ENV,
prefixPath,
})
// https://v3.nuxtjs.org/api/configuration/nuxt.config
export default defineNuxtConfig({
// debug: process.env.NODE_ENV !== 'production',
debug: false,
devtools: { enabled: false, },
modules: [
'@vueuse/nuxt',
'~/modules/sitemap',
'@tailvue/nuxt',
'@pinia/nuxt'
// '@kevinmarrec/nuxt-pwa'
],
sitemap: {
hostname: 'https://jiang-xia.top',
},
// pwa: {
// workbox: {
// enabled: process.env.NODE_ENV === 'production',
// },
// manifest: {
// name: 'Blog',
// short_name: 'Blog',
// },
// },
app: {
head: {
link: [
{ rel: 'stylesheet', href: 'https://cdn.staticfile.org/csshake/1.5.3/csshake.min.css', }
],
script: [
{ defer: true, src: 'https://cdn.staticfile.net/pdf-lib/1.17.1/pdf-lib.min.js', },
{ defer: true, src: 'https://cdn.staticfile.net/pdf.js/3.9.179/pdf.min.js', }
],
},
pageTransition: {
name: 'scale',
appear: true,
mode: 'out-in',
},
},
// build: {
// // 打开分析报告
// analyze: true,
// },
// buildDir: 'dist',
css: ['~/assets/css/main.css'],
postcss: {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
},
js: [],
vite: {
define: {},
plugins: [
Icons({
// the feature below is experimental ⬇️
autoInstall: true,
})
],
},
// head: {
// // 这里配置不生效
// script: [{ src: '', }],
// },
router: {},
// 此文件只能用process
nitro: {
// 配置代理
devProxy: {
[prefixPath]: {
target: process.env.VITE_NUXT_BASE_URL,
changeOrigin: true,
rewrite: (path: string) => path.replace(new RegExp(`^${prefixPath}`), ''),
},
},
},
devServer: {
// 证书安装 https://zhuanlan.zhihu.com/p/678165318
https: false,
},
})