| 1 | import react from "@vitejs/plugin-react-swc"; |
| 2 | import { resolve } from "path"; |
| 3 | import tailwindcss from "tailwindcss"; |
| 4 | import { defineConfig } from "vitest/config"; |
| 5 | |
| 6 | // https://vitejs.dev/config/ |
| 7 | export default defineConfig({ |
| 8 | plugins: [react(), tailwindcss()], |
| 9 | build: { |
| 10 | // Change the output .js filename to not include a hash |
| 11 | rollupOptions: { |
| 12 | input: { |
| 13 | index: resolve(__dirname, "index.html"), |
| 14 | indexConsole: resolve(__dirname, "indexConsole.html"), |
| 15 | }, |
| 16 | output: { |
| 17 | entryFileNames: `assets/[name].js`, |
| 18 | chunkFileNames: `assets/[name].js`, |
| 19 | assetFileNames: `assets/[name].[ext]`, |
| 20 | }, |
| 21 | }, |
| 22 | }, |
| 23 | server: { |
| 24 | cors: { |
| 25 | origin: "*", |
| 26 | methods: ["GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS"], |
| 27 | allowedHeaders: ["*", "Content-Type", "Authorization"], |
| 28 | credentials: true, |
| 29 | }, |
| 30 | }, |
| 31 | test: { |
| 32 | globals: true, |
| 33 | environment: "jsdom", |
| 34 | setupFiles: "./src/util/test/setupTests.ts", |
| 35 | }, |
| 36 | }); |