-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnuxt.config.ts
76 lines (74 loc) · 1.92 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
import AutoImport from 'unplugin-auto-import/vite'
import { NaiveUiResolver } from 'unplugin-vue-components/resolvers'
import Components from 'unplugin-vue-components/vite'
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
devtools: {
enabled: true,
timeline: {
enabled: true,
},
},
build: {
// transpile: ['vue-sonner'],
transpile: process.env.NODE_ENV === 'production' ? ['vue-sonner', 'naive-ui', 'vueuc', '@css-render/vue3-ssr', 'juggle/resize-observer'] : ['vue-sonner', '@juggle/resize-observer'],
},
vite: {
optimizeDeps: {
include:
process.env.NODE_ENV === 'development'
? ['naive-ui', 'vueuc', 'date-fns-tz/formatInTimeZone']
: [],
exclude: ['fsevents'],
},
plugins: [
AutoImport({
imports: [
{
'vue-sonner': ['toast'],
},
],
}),
Components({
resolvers: [NaiveUiResolver()],
}),
],
},
modules: ['@nuxt/ui', '@vueuse/nuxt', '@nuxtjs/color-mode', '@pinia/nuxt', '@pinia-plugin-persistedstate/nuxt', '@formkit/auto-animate/nuxt'],
colorMode: {
classSuffix: '',
preference: 'system', // default theme
dataValue: 'theme', // activate data-theme in <html> tag
},
css: ['~/assets/css/main.css'],
postcss: {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
},
runtimeConfig: {
public: {
// baseURL: process.env.BASE_URL || 'http://localhost:8888',
// baseURL: 'http://localhost:8888',
baseURL: process.env.BASE_URL,
},
},
routeRules: {
'/request/api/**': {
proxy: { to: `${process.env.BASE_URL}/api/**` },
// proxy: { to: 'http://127.0.0.1:4523/m1/3732090-0-default/api/**' },
},
},
app: {
head: {
meta: [
{ name: 'referrer', content: 'no-referrer' },
],
},
},
ignore: [
'**/*.test.*',
'**/script/**',
],
})