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(),
|
|
|
|
splitVendorChunkPlugin(),
|
|
|
|
VitePWA({ registerType: 'autoUpdate' }),
|
|
|
|
],
|
2023-08-24 04:20:53 +08:00
|
|
|
})
|