feat: Migración completa de SnatchGame a Nuxt 4
- Creado nuevo proyecto Nuxt 4 con estructura app/ - Servidor Colyseus separado para evitar problemas con decoradores - Migrado GameRoom y toda la lógica del juego - Implementado cliente con composables useGameClient - Panel de administración funcional - Componentes Vue migrados (HomeScreen, GameScreen, PlayerCard, etc) - Configuración para ejecutar ambos servidores (npm run dev:all)
This commit is contained in:
59
nuxt-snatchgame/nuxt.config.ts
Normal file
59
nuxt-snatchgame/nuxt.config.ts
Normal file
@@ -0,0 +1,59 @@
|
||||
// https://nuxt.com/docs/api/configuration/nuxt-config
|
||||
export default defineNuxtConfig({
|
||||
future: {
|
||||
compatibilityVersion: 4,
|
||||
},
|
||||
compatibilityDate: '2025-07-15',
|
||||
devtools: { enabled: true },
|
||||
|
||||
// Configure server
|
||||
nitro: {
|
||||
experimental: {
|
||||
websocket: true
|
||||
},
|
||||
// Enable WebSocket support
|
||||
devProxy: {
|
||||
'/ws': {
|
||||
target: 'ws://localhost:3000',
|
||||
ws: true,
|
||||
changeOrigin: true
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// Environment variables
|
||||
runtimeConfig: {
|
||||
public: {
|
||||
gameName: 'SnatchGame',
|
||||
wsUrl: process.env.NUXT_PUBLIC_WS_URL || 'ws://localhost:2567'
|
||||
}
|
||||
},
|
||||
|
||||
// TypeScript configuration
|
||||
typescript: {
|
||||
strict: true,
|
||||
shim: false,
|
||||
tsConfig: {
|
||||
compilerOptions: {
|
||||
experimentalDecorators: true,
|
||||
emitDecoratorMetadata: true
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// Disable SSR for game application
|
||||
ssr: false,
|
||||
|
||||
// Vite configuration for WebSocket support
|
||||
vite: {
|
||||
server: {
|
||||
proxy: {
|
||||
'/ws': {
|
||||
target: 'ws://localhost:3000',
|
||||
ws: true,
|
||||
changeOrigin: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user