forked from noxious/client
Prod. env improvements
This commit is contained in:
parent
5d4de60f90
commit
31a91c3f9f
@ -34,14 +34,15 @@ export function useGameControlsComposable(scene: Phaser.Scene, layer: Phaser.Til
|
|||||||
function handleKeyDown(event: KeyboardEvent) {
|
function handleKeyDown(event: KeyboardEvent) {
|
||||||
if (!gameStore.character) return
|
if (!gameStore.character) return
|
||||||
|
|
||||||
// console.log(event.key)
|
|
||||||
|
|
||||||
if (['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown'].includes(event.key)) {
|
if (['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown'].includes(event.key)) {
|
||||||
|
// Prevent key repeat events
|
||||||
|
if (event.repeat) return
|
||||||
|
|
||||||
pressedKeys.add(event.key)
|
pressedKeys.add(event.key)
|
||||||
|
|
||||||
// Start movement loop if not already running
|
// Start movement loop if not already running
|
||||||
if (!moveInterval) {
|
if (!moveInterval) {
|
||||||
moveInterval = window.setInterval(moveCharacter, 100) // Adjust timing as needed
|
moveInterval = window.setInterval(moveCharacter, 100) // Increased interval to match server throttle `MOVEMENT_THROTTLE`
|
||||||
moveCharacter() // Move immediately on first press
|
moveCharacter() // Move immediately on first press
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,8 +7,30 @@ import viteCompression from 'vite-plugin-compression';
|
|||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [
|
plugins: [
|
||||||
vue(),
|
vue(),
|
||||||
viteCompression()
|
viteCompression({
|
||||||
|
algorithm: 'gzip',
|
||||||
|
ext: '.gz',
|
||||||
|
threshold: 10240 // Only compress files larger than 10KB
|
||||||
|
})
|
||||||
],
|
],
|
||||||
|
build: {
|
||||||
|
minify: 'terser', // Better minification
|
||||||
|
terserOptions: {
|
||||||
|
compress: {
|
||||||
|
drop_console: true, // Remove console.log in production
|
||||||
|
drop_debugger: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
rollupOptions: {
|
||||||
|
output: {
|
||||||
|
manualChunks: {
|
||||||
|
'vendor': ['vue'], // Split vendor chunks
|
||||||
|
// Add other large dependencies here
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
chunkSizeWarningLimit: 1000, // Increase chunk size warning limit if needed
|
||||||
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
'@': fileURLToPath(new URL('./src', import.meta.url))
|
'@': fileURLToPath(new URL('./src', import.meta.url))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user