metacubexd/vite.config.ts

44 lines
1015 B
TypeScript
Raw Permalink Normal View History

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({
base: './',
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-01 17:08:00 +08:00
splitVendorChunkPlugin(),
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
})