vite.config.ts 853 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import path from "path"
  2. import { defineConfig } from "vite"
  3. import react from "@vitejs/plugin-react"
  4. import tailwindcss from "@tailwindcss/vite"
  5. // https://vitejs.dev/config/
  6. export default defineConfig({
  7. plugins: [react(), tailwindcss()],
  8. resolve: {
  9. alias: {
  10. "@": path.resolve(__dirname, "./src"),
  11. },
  12. },
  13. build: {
  14. outDir: "build",
  15. reportCompressedSize: false,
  16. rollupOptions: {
  17. output: {
  18. entryFileNames: `assets/[name].js`,
  19. chunkFileNames: `assets/[name].js`,
  20. assetFileNames: `assets/[name].[ext]`,
  21. },
  22. },
  23. },
  24. server: {
  25. hmr: {
  26. host: "localhost",
  27. protocol: "ws",
  28. },
  29. cors: {
  30. origin: "*",
  31. methods: "*",
  32. allowedHeaders: "*",
  33. },
  34. },
  35. define: {
  36. "process.platform": JSON.stringify(process.platform),
  37. "process.env.VSCODE_TEXTMATE_DEBUG": JSON.stringify(process.env.VSCODE_TEXTMATE_DEBUG),
  38. },
  39. })