vite.config.ts 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import { defineConfig } from "vite";
  2. import vue from "@vitejs/plugin-vue";
  3. import { VitePWA } from 'vite-plugin-pwa'
  4. const vueJsx = require('@vitejs/plugin-vue-jsx')
  5. const legacy = require('@vitejs/plugin-legacy')
  6. const proxyUrl = "https://test.dayaedu.com/"; // test 环境
  7. // https://vitejs.dev/config/
  8. export default defineConfig({
  9. base: "./",
  10. plugins: [
  11. vue(),
  12. vueJsx(),
  13. legacy({
  14. targets: ["> 0.25%, not dead"],
  15. ignoreBrowserslistConfig: true,
  16. }),
  17. VitePWA({
  18. injectRegister: 'networkfirst',
  19. workbox: {
  20. cleanupOutdatedCaches: true
  21. },
  22. base: './',
  23. manifest: {
  24. name: '管乐迷',
  25. short_name: '管乐迷',
  26. theme_color: '#01C1B5',
  27. icons: [
  28. {
  29. src: './pwa-192x192.png',
  30. sizes: '192x192',
  31. type: 'image/png',
  32. },
  33. {
  34. src: './pwa-512x512.png',
  35. sizes: '512x512',
  36. type: 'image/png',
  37. },
  38. ],
  39. },
  40. }),
  41. ],
  42. });