Added dot env support

This commit is contained in:
Dennis Postma 2024-09-28 20:02:59 +02:00
parent b4050bee01
commit 31ce0a8264
2 changed files with 12 additions and 10 deletions

5
.env.example Normal file
View File

@ -0,0 +1,5 @@
VITE_NAME=New Quest
VITE_DEVELOPMENT=true
VITE_SERVER_ENDPOINT=http://localhost:4000
VITE_TILE_SIZE_X=64
VITE_TILE_SIZE_Y=32

View File

@ -1,12 +1,9 @@
const dev: boolean = false
export default { export default {
name: 'New Quest', name: import.meta.env.VITE_NAME,
development: dev, development: import.meta.env.VITE_DEVELOPMENT === 'true',
server_endpoint: dev ? 'http://localhost:4000' : 'https://nq-server.cr-a.directonline.io', server_endpoint: import.meta.env.VITE_SERVER_ENDPOINT,
tile_size: { x: 64, y: 32, z: 1 } tile_size: {
x: Number(import.meta.env.VITE_TILE_SIZE_X),
y: Number(import.meta.env.VITE_TILE_SIZE_Y),
}
} }
/**
* @TODO: Implement .env like server has
*/