-
Notifications
You must be signed in to change notification settings - Fork 1
/
nuxt.config.ts
97 lines (86 loc) · 2.05 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
94
95
96
97
import dayjs from 'dayjs'
export default defineNuxtConfig({
modules: [
// '@nuxt/devtools',
'@nuxt/image-edge',
'@vueuse/nuxt',
'@pinia/nuxt',
'@unocss/nuxt',
'@vue-macros/nuxt',
'@element-plus/nuxt',
'@nuxtjs/color-mode',
'@element-plus/nuxt',
'@nuxtjs/i18n',
'nuxt-swiper',
'nuxt-icons',
],
css: [
// '@unocss/reset/tailwind.css',
'@unocss/reset/eric-meyer.css',
'~/styles/index.scss', // global css
],
imports: {
// Auto-import pinia stores defined in `~/stores`
dirs: ['stores'],
},
elementPlus: {
importStyle: 'scss',
themes: ['dark'],
},
// https://color-mode.nuxtjs.org/#configuration
colorMode: {
// default options
preference: 'system', // default value of $colorMode.preference
fallback: 'light', // fallback value if not system preference found
// hid: 'nuxt-color-mode-script',
// globalName: '__NUXT_COLOR_MODE__',
// componentName: 'ColorScheme',
// classPrefix: '',
classSuffix: '',
// storageKey: 'nuxt-color-mode'
},
i18n: {
locales: [
{ code: 'en', file: 'en_US.json', name: 'English' },
{ code: 'tw', file: 'zh_TW.json', name: '繁體中文' },
{ code: 'zh', file: 'zh_CN.json', name: '简体中文' },
],
lazy: true,
langDir: 'locales',
defaultLocale: 'en',
},
swiper: {
// Swiper options
// ----------------------
// prefix: 'Swiper',
// styleLang: 'css',
modules: ['autoplay', 'controller'],
},
unocss: {
preflight: false,
},
app: {
pageTransition: { name: 'page', mode: 'out-in' },
buildAssetsDir: 'static',
// keepalive: true,
},
runtimeConfig: {
public: {
env: 'development',
},
},
vite: {
// need add declare from xxx.d.ts
define: {
__BUILD_TIME__: JSON.stringify(dayjs().format('YYYY/MM/DD HH:mm')),
},
css: {
preprocessorOptions: {
scss: {
// 主题定制方案 (not as *)
additionalData: '@use "~/styles/element/index.scss";',
},
},
},
},
})