-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
33 lines (30 loc) · 904 Bytes
/
vite.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { defineConfig, loadEnv } from 'vite';
import react from '@vitejs/plugin-react';
import viteTsconfigPaths from 'vite-tsconfig-paths';
import svgrPlugin from 'vite-plugin-svgr';
import { VitePWA, VitePWAOptions } from 'vite-plugin-pwa';
import manifest from './public/manifest.json';
export const pwaOptions: Partial<VitePWAOptions> = {
base: '/quran',
devOptions: {
enabled: true,
navigateFallback: 'index.html',
type: 'module',
},
manifest,
registerType: 'autoUpdate',
};
// https://vitejs.dev/config/
export default defineConfig(({ mode }) => {
process.env = { ...process.env, ...loadEnv(mode, process.cwd(), '') };
return {
plugins: [react(), VitePWA(pwaOptions), viteTsconfigPaths(), svgrPlugin()],
server: {
open: Boolean(process.env.BROWSER),
port: Number(process.env.PORT) || 8100,
},
build: {
outDir: 'build',
},
};
});