vite.config.ts 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. import { defineConfig } from "vite";
  2. import { fresh } from "@fresh/plugin-vite";
  3. import tailwindcss from "@tailwindcss/vite";
  4. import { VitePWA } from "vite-plugin-pwa";
  5. export default defineConfig({
  6. plugins: [
  7. fresh(),
  8. tailwindcss(),
  9. VitePWA({
  10. registerType: "autoUpdate",
  11. manifest: {
  12. name: "Postdown",
  13. short_name: "Postdown",
  14. description: "A web-based, shareable, self-hosted Markdown editor",
  15. start_url: "/",
  16. display: "standalone",
  17. background_color: "#ffffff",
  18. theme_color: "#1e293b",
  19. orientation: "any",
  20. icons: [
  21. {
  22. src: "/icon-192.png",
  23. sizes: "192x192",
  24. type: "image/png",
  25. },
  26. {
  27. src: "/icon-512.png",
  28. sizes: "512x512",
  29. type: "image/png",
  30. },
  31. ],
  32. },
  33. workbox: {
  34. navigateFallback: "/",
  35. runtimeCaching: [
  36. {
  37. urlPattern: /^https?:\/\/.*\/.*/i,
  38. handler: "NetworkFirst",
  39. options: {
  40. cacheName: "postdown-runtime",
  41. expiration: {
  42. maxEntries: 100,
  43. },
  44. },
  45. },
  46. ],
  47. },
  48. }),
  49. ],
  50. server: {
  51. port: 8000,
  52. watch: {
  53. ignored: ["**/data/**"],
  54. },
  55. },
  56. });