/ vite.config.ts
vite.config.ts
 1  import { defineConfig } from 'vite'
 2  // import legacy from '@vitejs/plugin-legacy'
 3  import react, { reactCompilerPreset } from '@vitejs/plugin-react'
 4  import babel from '@rolldown/plugin-babel'
 5  import tailwindcss from '@tailwindcss/vite'
 6  import { VitePWA as pwa } from 'vite-plugin-pwa'
 7  
 8  const name = 'RadixVerse'
 9  
10  export default defineConfig({
11  	base: process.env.BASE_URL ?? '/',
12  	build: { sourcemap: true },
13  	plugins: [
14  		// legacy({
15  		// 	modernTargets: 'chrome>=122, edge>=122, safari>=18, firefox>=131, chromeAndroid>=132, iOS>=18',
16  		// 	modernPolyfills: [ 'es/iterator' ],
17  		// 	renderLegacyChunks: false,
18  		// }),
19  		react(),
20  		babel({ presets: [ reactCompilerPreset() ] }),
21  		tailwindcss(),
22  		pwa({
23  			devOptions: { enabled: true },
24  			injectRegister: 'script',
25  			registerType: 'autoUpdate',
26  			includeAssets: [ 'images/*.{ico,png}' ],
27  			manifest: {
28  				name,
29  				short_name: name,
30  				display: 'standalone',
31  				theme_color: '#f1f1f1',
32  				background_color: '#f1f1f1',
33  				icons: [{
34  					src: 'images/icon-64x64.png',
35  					sizes: '64x64',
36  					type: 'image/png',
37  				}, {
38  					src: 'images/icon-192x192.png',
39  					sizes: '192x192',
40  					type: 'image/png',
41  				}, {
42  					src: 'images/icon-512x512.png',
43  					sizes: '512x512',
44  					type: 'image/png',
45  				}, {
46  					src: 'images/icon-512x512.png',
47  					sizes: '512x512',
48  					type: 'image/png',
49  					purpose: 'maskable',
50  				}]
51  			}
52  		})
53  	]
54  })