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-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(),
|
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',
|
2024-10-10 19:24:19 +08:00
|
|
|
includeAssets: ['favicon.svg'],
|
2024-09-19 21:31:28 +08:00
|
|
|
workbox: { maximumFileSizeToCacheInBytes: 5 * 1024 * 1024 },
|
2023-09-17 13:10:35 +08:00
|
|
|
manifest: {
|
2024-10-10 19:19:49 +08:00
|
|
|
name: 'MetaCubeXD',
|
|
|
|
short_name: 'MetaCubeXD',
|
|
|
|
description: 'Mihomo Dashboard, The Official One, XD',
|
|
|
|
theme_color: '#000000',
|
2023-09-17 13:10:35 +08:00
|
|
|
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
|
|
|
})
|