feat(dev): add hot-realoding proxy dev server on :30001

This commit is contained in:
Konstantin Chernyshev 2025-09-02 19:13:31 +02:00
parent 1b9defe4ad
commit ddb4c29252
7 changed files with 315 additions and 40 deletions

View file

@ -16,12 +16,23 @@ if (fs.existsSync('.env')) {
// Set defaults if not in environment
const foundryPath = process.env.FOUNDRY_MAIN_PATH || '../../../../FoundryDev/main.js';
const dataPath = process.env.FOUNDRY_DATA_PATH || '../../../';
const foundryPort = process.env.FOUNDRY_PORT || '30000';
// Run the original command with proper environment
const args = ['rollup -c --watch', `node "${foundryPath}" --dataPath="${dataPath}" --noupnp`, 'gulp'];
const args = [
'rollup -c --watch',
`node "${foundryPath}" --dataPath="${dataPath}" --noupnp --port=${foundryPort}`,
'gulp',
'node ./tools/dev-proxy.mjs'
];
spawn('npx', ['concurrently', ...args.map(arg => `"${arg}"`)], {
stdio: 'inherit',
cwd: process.cwd(),
shell: true
});
// Friendly hint
console.log('\n\x1b[32mDev proxy: http://localhost:30001\x1b[0m (overlay)');
console.log(`\x1b[36mFoundry: http://localhost:${foundryPort}\x1b[0m (installed)`);
console.log('\nOpen http://localhost:30001 to see your dev version, or close it to return to the installed version.');