Add proxy target configuration and new start script for seedheads dev mode

This commit is contained in:
seb
2025-07-02 13:21:08 +02:00
parent edbd56f6a9
commit 10b7f0ed7b
5 changed files with 63 additions and 4 deletions

View File

@@ -91,6 +91,7 @@ const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const isDevelopment = process.env.NODE_ENV !== 'production';
const isAnalyze = process.env.ANALYZE === 'true';
const proxyTarget = process.env.PROXY_TARGET || 'http://localhost:9303';
export default {
mode: isDevelopment ? 'development' : 'production',
@@ -267,16 +268,18 @@ export default {
proxy: [
{
context: ['/socket.io'],
target: 'http://localhost:9303',
target: proxyTarget,
changeOrigin: true,
ws: true,
logLevel: 'debug'
logLevel: 'debug',
secure: proxyTarget.startsWith('https')
},
{
context: ['/api'],
target: 'http://localhost:9303',
target: proxyTarget,
changeOrigin: true,
logLevel: 'debug'
logLevel: 'debug',
secure: proxyTarget.startsWith('https')
}
],
setupMiddlewares: (middlewares, devServer) => {