From 9979fb33b4cebc471406c5bdbbe3697f4b848e3d Mon Sep 17 00:00:00 2001 From: yun-cheng Date: Fri, 22 Mar 2024 16:24:58 +0800 Subject: [PATCH] fix(deploy): remove vite-plugin-pwa config to resolve GitHub Actions build error --- src/main.tsx | 3 --- vite.config.ts | 33 +-------------------------------- 2 files changed, 1 insertion(+), 35 deletions(-) diff --git a/src/main.tsx b/src/main.tsx index 5295338..ce072ba 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -4,11 +4,8 @@ import App from 'App' import { StrictMode } from 'react' import { createRoot } from 'react-dom/client' import theme from 'utils/muiThemeConfig' -import { registerSW } from 'virtual:pwa-register' import './index.css' -registerSW() - const MAX_RETRIES = 1 const queryClient = new QueryClient({ defaultOptions: { diff --git a/vite.config.ts b/vite.config.ts index 44854ff..aaa77f6 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -2,7 +2,6 @@ import eslintPlugin from '@nabla/vite-plugin-eslint' import react from '@vitejs/plugin-react' import { defineConfig } from 'vite' -import { VitePWA } from 'vite-plugin-pwa' import svgr from 'vite-plugin-svgr' import tsconfigPaths from 'vite-tsconfig-paths' @@ -30,36 +29,6 @@ export default defineConfig(({ mode }) => ({ tsconfigPaths(), react(), svgr(), - ...(mode === 'test' - ? [] - : [ - eslintPlugin(), - VitePWA({ - registerType: 'autoUpdate', - includeAssets: [ - 'favicon.png', - 'robots.txt', - 'apple-touch-icon.png', - 'icons/*.svg', - 'fonts/*.woff2' - ], - manifest: { - theme_color: '#BD34FE', - icons: [ - { - src: '/android-chrome-192x192.png', - sizes: '192x192', - type: 'image/png', - purpose: 'any maskable' - }, - { - src: '/android-chrome-512x512.png', - sizes: '512x512', - type: 'image/png' - } - ] - } - }) - ]) + ...(mode === 'test' ? [] : [eslintPlugin()]) ] }))