-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnuxt.config.ts
51 lines (50 loc) · 1.34 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
// https://nuxt.com/docs/api/configuration/nuxt-config
import { resolve } from 'pathe'
export default defineNuxtConfig({
alias: {
"@": resolve(__dirname, "./"),
"@pages": resolve(__dirname, "./pages"),
"@server": resolve(__dirname, "./server"),
'images': resolve(__dirname, './assets/images'),
'style': resolve(__dirname, './assets/style'),
},
build: { transpile: ["echarts"] },
// runtimeConfig:需要在使用环境变量构建后指定的私有或公共令牌。
runtimeConfig: {
// The private keys which are only available server-side
apiSecret: '123',
// Keys within public are also exposed client-side
public: {
apiBase: '/api'
}
}
// router: {
// extendRoutes(routes, resolve) {
// routes.push({
// name: 'custom',
// path: '*',
// component: resolve(__dirname, 'pages/404.vue')
// })
// }
// }
// vite代理方式,nitro 代理都可以成功
// , vite: {
// server: {
// proxy: {
// '/api': {
// target: 'http://127.0.0.1:3000/',
// // rewrite: (path) => path.replace(/^\/api/, ''),
// }
// },
// }
// }
// , nitro: {
// devProxy: {
// "/api": {
// target: 'http://127.0.0.1:3000/',
// prependPath: true,
// changeOrigin: true,
// }
// }
// }
})