mirror of
https://github.com/knadh/listmonk.git
synced 2025-03-03 01:34:30 +08:00
38 lines
948 B
JavaScript
38 lines
948 B
JavaScript
|
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\/custom\.(css|js))': {
|
||
|
target: env.LISTMONK_API_URL || 'http://127.0.0.1:9000',
|
||
|
},
|
||
|
},
|
||
|
},
|
||
|
};
|
||
|
});
|