metacubexd/vite.config.ts

52 lines
1.1 KiB
TypeScript
Raw Normal View History

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({
base: './',
build: { chunkSizeWarningLimit: 1000 },
resolve: { alias: { '~': '/src' } },
2024-09-19 21:31:28 +08:00
2024-03-11 20:05:08 +08:00
define: {
'import.meta.env.APP_VERSION': JSON.stringify(
process.env.npm_package_version,
),
},
2024-09-19 21:31:28 +08:00
2023-09-01 17:08:00 +08:00
plugins: [
solidPlugin(),
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
}),
VitePWA({
registerType: 'autoUpdate',
includeAssets: ['favicon.svg'],
2024-09-19 21:31:28 +08:00
workbox: { maximumFileSizeToCacheInBytes: 5 * 1024 * 1024 },
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
})