forked from knadh/listmonk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
40 lines (38 loc) · 1.03 KB
/
vite.config.js
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
import vue from '@vitejs/plugin-vue2';
import { defineConfig, loadEnv } from 'vite';
const path = require('path');
// https://vitejs.dev/config/
export default defineConfig(({ _, mode }) => {
const env = loadEnv(mode, process.cwd(), '');
return {
plugins: [vue()],
base: '/admin',
mode,
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
bulma: require.resolve('bulma/bulma.sass'),
},
},
build: {
assetsDir: 'static',
},
server: {
port: env.LISTMONK_FRONTEND_PORT || 8080,
proxy: {
'^/$': {
target: env.LISTMONK_API_URL || 'http://127.0.0.1:9000',
},
'^/(api|webhooks|subscription|public|health)': {
target: env.LISTMONK_API_URL || 'http://127.0.0.1:9000',
},
'^/admin/login': {
target: env.LISTMONK_API_URL || 'http://127.0.0.1:9000',
},
'^/(admin\/custom\.(css|js))': {
target: env.LISTMONK_API_URL || 'http://127.0.0.1:9000',
},
},
},
};
});