-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnuxt.config.ts
More file actions
115 lines (97 loc) · 2.81 KB
/
nuxt.config.ts
File metadata and controls
115 lines (97 loc) · 2.81 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
105
106
107
108
109
110
111
112
113
114
115
// https://nuxt.com/docs/api/configuration/nuxt-config
import { createResolver } from '@nuxt/kit'
import type { BuildInfo } from './types'
const { resolve } = createResolver(import.meta.url)
// https://nuxt.com/modules
export default defineNuxtConfig({
runtimeConfig: {
public: {
version: process.env.NODE_ENV || 'development', // 或者其他环境变量
},
},
ssr: false,
vue: {
propsDestructure: true,
},
imports: {
autoImport: true,
},
css: ['tailwindcss/lib/css/preflight.css', '~/assets/scss/index.scss', 'floating-vue/dist/style.css'],
// css: ['~/tailwindcss/scss/preflight.css', '~/assets/scss/index.scss', 'floating-vue/dist/style.css'],
app: {
// see: https://github.com/vuejs/core/issues/10415
keepalive: false,
pageTransition: { name: 'page', mode: 'out-in' },
head: {
// TODO: production env Django埋点项目 白名单
script: [],
viewport: 'width=device-width,initial-scale=1,viewport-fit=cover',
bodyAttrs: {
class: 'overflow-x-hidden',
},
link: [
{ rel: 'icon', href: '/favicon.ico', sizes: 'any' },
{ rel: 'icon', type: 'image/svg+xml', href: '/favicon.ico' },
{ rel: 'apple-touch-icon', href: '/favicon.ico' },
],
meta: [
{ name: 'apple-mobile-web-app-status-bar-style', content: 'black-translucent' },
// open graph social image
{ property: 'og:title', content: 'nuxt3管理系统' },
{ property: 'og:description', content: '高效电子元器件后台管理系统' },
{ property: 'og:type', content: 'website' },
{ property: 'og:image', content: 'https://placehold.co/800x/667fff/ffffff.png?text=nuxt3-admin+Image&font=Montserrat' },
{ property: 'og:image:width', content: '3800' },
{ property: 'og:image:height', content: '1900' },
{ property: 'og:site_name', content: 'nuxt3-admin' },
],
},
},
vite: {
optimizeDeps: {
include: [
'@vueuse/integrations/useFocusTrap',
],
},
build: {
target: 'esnext',
},
},
devtools: { enabled: true },
modules: [
'@vueuse/nuxt',
'@nuxtjs/tailwindcss',
'@pinia/nuxt',
'@element-plus/nuxt',
'@nuxtjs/color-mode',
'@nuxtjs/svg-sprite',
'nuxt-lodash',
// custom modules
// '~/modules/build-env',
],
elementPlus: {
icon: 'ElIcon',
importStyle: 'scss',
themes: [],
},
nitro: {
devProxy: {
'/api': { target: '', changeOrigin: true },
},
publicAssets: [
{
dir: resolve('./public/files'),
maxAge: 24 * 60 * 60 * 30, // 30 days
baseURL: '/files',
},
],
},
compatibilityDate: '2025-03-13',
})
declare module '@nuxt/schema' {
interface AppConfig {
storage: any
env: BuildInfo['env']
buildInfo: BuildInfo
}
}