import { defineConfig } from "vite"; import fs from "node:fs"; import path from "node:path"; import { fileURLToPath } from "node:url"; const __dirname = path.dirname(fileURLToPath(import.meta.url)); const rootDir = path.resolve(__dirname, "../.."); const httpsConfig = { key: fs.readFileSync(path.join(rootDir, "certs/localhost+2-key.pem")), cert: fs.readFileSync(path.join(rootDir, "certs/localhost+2.pem")) }; export default defineConfig({ server: { port: 5174, strictPort: true, https: httpsConfig, headers: { "Cross-Origin-Resource-Policy": "same-site" }, proxy: { "/api": "http://127.0.0.1:3001", "/storage": "http://127.0.0.1:3001" } } });