many many fixes

This commit is contained in:
2026-10-26 10:06:30 -04:00
parent 79e15cb8c3
commit f1a13a3065
25 changed files with 642 additions and 9964 deletions

32
vite.config.js Normal file
View File

@@ -0,0 +1,32 @@
import fs from 'node:fs';
import { defineConfig } from 'vite';
const VERSION_FILE = new URL('./src/version.json', import.meta.url);
// src/version.json is imported by the app (baked into the bundle) and also
// published as /version.json, which running clients poll to detect new deploys.
function versionFilePlugin() {
return {
name: 'quartiles-version-file',
// Dev: always serve the current file contents, uncached
configureServer(server) {
server.middlewares.use('/version.json', (req, res) => {
res.setHeader('Content-Type', 'application/json');
res.setHeader('Cache-Control', 'no-store');
res.end(fs.readFileSync(VERSION_FILE, 'utf8'));
});
},
// Build: emit dist/version.json
generateBundle() {
this.emitFile({
type: 'asset',
fileName: 'version.json',
source: fs.readFileSync(VERSION_FILE, 'utf8')
});
}
};
}
export default defineConfig({
plugins: [versionFilePlugin()]
});