import { fileURLToPath, URL } from "url"; import { VitePWA } from "vite-plugin-pwa"; import { defineConfig } from "vite"; import vue from "@vitejs/plugin-vue"; // https://vitejs.dev/config/ export default defineConfig({ // publicDir: 'public', // includeAssets: ['public/answers/*.web'], plugins: [ vue(), VitePWA({ name: "My First Progressive Web app", short_name: "First PWA", theme_color: "#eb5252", background_color: "#000000", registerType: "autoUpdate", injectRegister: "auto", // add this to cache all the imports workbox: { globPatterns: ["**/*"], }, // add this to cache all the // static assets in the public folder includeAssets: ["**/*"], useCredentials: true, manifest: { theme_color: "#eb5252", orientation: "portrait", display: "fullscreen", scope: "/", icons: [ { src: "/images/pwa-icon-256.png", sizes: "192x192", type: "image/png", purpose: "any maskable", }, { src: "/images/pwa-icon-512.png", sizes: "512x512", type: "image/png", purpose: "any maskable", }, ], }, devOptions: { enabled: true, }, }), ], resolve: { alias: { "@": fileURLToPath(new URL("./src", import.meta.url)), }, }, });