enable dev|prod envs with simpler env vars system
This commit is contained in:
@@ -2,7 +2,6 @@ import tailwindcss from '@tailwindcss/vite';
|
||||
import { defineConfig } from 'vite';
|
||||
import adapter from '@sveltejs/adapter-node';
|
||||
import { sveltekit } from '@sveltejs/kit/vite';
|
||||
import { SERVER_IP, FRONTEND_PORT, PROXY_PORT } from '../config.ts';
|
||||
|
||||
export default defineConfig(() => {
|
||||
return {
|
||||
@@ -25,11 +24,13 @@ export default defineConfig(() => {
|
||||
fs: {
|
||||
allow: ['.', './node_modules', '../node_modules']
|
||||
},
|
||||
allowedHosts: [SERVER_IP],
|
||||
port: FRONTEND_PORT,
|
||||
// Dev only: allow access via any host/LAN IP without hardcoding it.
|
||||
allowedHosts: true,
|
||||
port: 2080,
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: `http://${SERVER_IP}:${PROXY_PORT}`,
|
||||
// The vite dev server and Hono proxy run on the same host.
|
||||
target: `http://127.0.0.1:3456`,
|
||||
changeOrigin: true
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user