added systemd service howto traefik nginix set_real_ip_from improved readme visuals fixed on mobile labels removed updated readme fixed visuals overlay for the hotkey disable screen lock clean up git precommit hooks clean up clean up update check for update feature added build-time information fixed date clean up added hook script fix fix fix hooks fixed webhook setup players stay in run all timers mode mqtt mqtt allways connected mqtt messages work capturing mqtt in edit player mqtt in Setup updated readme state of the mqtt Global Pass turn offline mode docs: update documentation to reflect current codebase and MQTT features - Update README.md with global MQTT commands - Enhance architecture.md with comprehensive data model and MQTT state - Update development.md with project structure and workflow - Remove redundant script listings - Fix formatting and organization
53 lines
1.7 KiB
JavaScript
53 lines
1.7 KiB
JavaScript
import { defineConfig } from 'vite';
|
|
import vue from '@vitejs/plugin-vue';
|
|
import fs from 'fs';
|
|
import { resolve } from 'path';
|
|
|
|
const packageJson = JSON.parse(fs.readFileSync('./package.json', 'utf8'));
|
|
const appVersion = packageJson.version;
|
|
|
|
// Get current date (this will be the server's local time where the build runs)
|
|
const now = new Date();
|
|
|
|
// Options for date formatting, targeting CET/CEST
|
|
const dateTimeFormatOptionsCEST = {
|
|
year: 'numeric', month: '2-digit', day: '2-digit',
|
|
hour: '2-digit', minute: '2-digit', second: '2-digit',
|
|
hour12: false, // Use 24-hour format
|
|
timeZone: 'Europe/Bratislava' // Or 'Europe/Prague', 'Europe/Berlin', etc. (any major CET/CEST city)
|
|
// This will automatically handle Daylight Saving Time (CEST vs CET)
|
|
};
|
|
|
|
// Generate build time string using a specific time zone that observes CET/CEST
|
|
const appBuildTime = now.toLocaleString('sk-SK', dateTimeFormatOptionsCEST) + " CEST/CET"; // Add timezone indicator for clarity
|
|
|
|
|
|
export default defineConfig({
|
|
plugins: [vue()],
|
|
server: {
|
|
port: 8080
|
|
},
|
|
define: {
|
|
'import.meta.env.VITE_APP_BUILD_TIME': JSON.stringify(appBuildTime),
|
|
'__APP_CACHE_VERSION__': JSON.stringify(`nexus-timer-cache-v${appVersion}-${Date.now()}`)
|
|
},
|
|
build: {
|
|
rollupOptions: {
|
|
input: {
|
|
main: resolve(__dirname, 'index.html'),
|
|
sw: resolve(__dirname, 'src/sw.js')
|
|
},
|
|
output: {
|
|
entryFileNames: assetInfo => {
|
|
if (assetInfo.name === 'sw') {
|
|
return 'service-worker.js';
|
|
}
|
|
return 'assets/[name]-[hash].js';
|
|
},
|
|
chunkFileNames: 'assets/[name]-[hash].js',
|
|
assetFileNames: 'assets/[name]-[hash].[ext]',
|
|
}
|
|
},
|
|
emptyOutDir: true,
|
|
}
|
|
}); |