This commit is contained in:
Jamie Curnow
2025-09-02 23:56:00 +10:00
parent a12553fec7
commit ebd9148813
355 changed files with 8621 additions and 18874 deletions

44
frontend/vite.config.ts Normal file
View File

@@ -0,0 +1,44 @@
import react from "@vitejs/plugin-react";
import { defineConfig } from "vite";
import checker from "vite-plugin-checker";
import tsconfigPaths from "vite-tsconfig-paths";
import "vitest/config";
import { execFile } from "node:child_process";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
{
name: "trigger-script-on-reload",
configureServer(server) {
server.watcher.on("change", (file) => {
if (file.includes("locale/src")) {
console.log(`File changed: ${file}, running locale-compile script...`);
execFile("yarn", ["locale-compile"], (error, stdout, _stderr) => {
if (error) {
throw error;
}
console.log(stdout);
});
}
});
},
},
react(),
checker({
// e.g. use TypeScript check
typescript: true,
}),
tsconfigPaths(),
],
server: {
host: true,
port: 5173,
strictPort: true,
allowedHosts: true,
},
test: {
environment: "happy-dom",
setupFiles: ["./vitest-setup.js"],
},
});