2023-08-29 14:44:49 +08:00
|
|
|
import { defineConfig, splitVendorChunkPlugin } from 'vite'
|
2023-09-01 17:08:00 +08:00
|
|
|
import { VitePWA } from 'vite-plugin-pwa'
|
2023-08-24 04:20:53 +08:00
|
|
|
import solidPlugin from 'vite-plugin-solid'
|
2023-09-03 18:16:09 +08:00
|
|
|
import pkgJSON from './package.json'
|
2023-08-24 04:20:53 +08:00
|
|
|
|
|
|
|
export default defineConfig({
|
2023-08-30 10:18:11 +08:00
|
|
|
base: './',
|
2023-08-29 14:44:49 +08:00
|
|
|
build: { chunkSizeWarningLimit: 1000 },
|
|
|
|
resolve: { alias: { '~': '/src' } },
|
2023-09-03 18:16:09 +08:00
|
|
|
define: {
|
|
|
|
'import.meta.env.version': JSON.stringify(pkgJSON.version),
|
|
|
|
},
|
2023-09-01 17:08:00 +08:00
|
|
|
plugins: [
|
|
|
|
solidPlugin(),
|
2023-09-17 13:10:35 +08:00
|
|
|
|
2023-09-01 17:08:00 +08:00
|
|
|
splitVendorChunkPlugin(),
|
2023-09-17 13:10:35 +08:00
|
|
|
|
|
|
|
VitePWA({
|
|
|
|
registerType: 'autoUpdate',
|
|
|
|
includeAssets: ['favicon.svg'],
|
|
|
|
manifest: {
|
|
|
|
icons: [
|
|
|
|
{
|
|
|
|
src: 'pwa-192x192.png',
|
|
|
|
sizes: '192x192',
|
|
|
|
type: 'image/png',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
src: '/pwa-512x512.png',
|
|
|
|
sizes: '512x512',
|
|
|
|
type: 'image/png',
|
|
|
|
},
|
|
|
|
{
|
|
|
|
src: 'pwa-512x512.png',
|
|
|
|
sizes: '512x512',
|
|
|
|
type: 'image/png',
|
|
|
|
purpose: 'any maskable',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
}),
|
2023-09-01 17:08:00 +08:00
|
|
|
],
|
2023-08-24 04:20:53 +08:00
|
|
|
})
|