space-game/vite.config.ts
Michael Mainguy 17c98c6102
All checks were successful
Build / build (push) Successful in 1m25s
Fix explosion audio delay by using lightweight TransformNode
Changes:
- Replace MeshBuilder.CreateSphere() with TransformNode in rockFactory.ts
- Eliminates 15-50ms geometry creation delay before audio playback
- Spatial audio only needs position data, not full mesh geometry
- Sound now plays immediately on asteroid collision

Technical details:
- TransformNode is a lightweight position container with no geometry
- No vertex buffers or WebGL resources to allocate
- Instantaneous creation removes blocking operation from critical path
- Maintains spatial audio positioning without performance overhead

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-10 14:04:16 -06:00

34 lines
615 B
TypeScript

import {defineConfig} from "vite";
/** @type {import('vite').UserConfig} */
export default defineConfig({
test: {},
define: {},
build: {
sourcemap: true,
rollupOptions: {
output: {
manualChunks: {
'babylon': ['@babylonjs/core']
}
}
}
},
optimizeDeps: {
esbuildOptions: {
define: {
global: 'window',
}
}
},
server: {
port: 3000,
allowedHosts: true
},
preview: {
port: 3000,
},
base: "/"
})