2024-04-16 17:52:44 +08:00
|
|
|
import AutoImport from 'unplugin-auto-import/vite'
|
2024-04-16 17:34:29 +08:00
|
|
|
import { defineConfig } 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'
|
|
|
|
|
|
|
|
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' } },
|
2024-03-11 20:05:08 +08:00
|
|
|
define: {
|
|
|
|
'import.meta.env.APP_VERSION': JSON.stringify(
|
|
|
|
process.env.npm_package_version,
|
|
|
|
),
|
|
|
|
},
|
2023-09-01 17:08:00 +08:00
|
|
|
plugins: [
|
|
|
|
solidPlugin(),
|
2023-09-17 13:10:35 +08:00
|
|
|
|
2024-04-16 17:52:44 +08:00
|
|
|
AutoImport({
|
2024-04-23 13:56:12 +08:00
|
|
|
imports: ['solid-js'],
|
|
|
|
packagePresets: ['@solidjs/router'],
|
2024-04-16 17:52:44 +08:00
|
|
|
}),
|
|
|
|
|
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
|
|
|
})
|