mirror of
https://github.com/MetaCubeX/metacubexd.git
synced 2024-11-24 09:45:35 +08:00
feat: get package.json version from npm builtin environment variable
This commit is contained in:
parent
eb6944fb2a
commit
0cdf390c28
@ -497,7 +497,7 @@ const Versions: Component<{ backendVersion: Accessor<string> }> = ({
|
||||
|
||||
return (
|
||||
<div class="grid grid-cols-2 gap-4">
|
||||
<kbd class="kbd">{import.meta.env.version}</kbd>
|
||||
<kbd class="kbd">{import.meta.env.VITE_APP_VERSION}</kbd>
|
||||
|
||||
<div class="relative">
|
||||
<Show when={isUpdateAvailable()}>
|
||||
|
2
src/vite-env.d.ts
vendored
2
src/vite-env.d.ts
vendored
@ -1,5 +1,5 @@
|
||||
interface ImportMetaEnv {
|
||||
readonly version: string
|
||||
readonly VITE_APP_VERSION: string
|
||||
}
|
||||
|
||||
interface ImportMeta {
|
||||
|
@ -1,18 +1,13 @@
|
||||
import { defineConfig, splitVendorChunkPlugin } from 'vite'
|
||||
import { VitePWA } from 'vite-plugin-pwa'
|
||||
import solidPlugin from 'vite-plugin-solid'
|
||||
import pkgJSON from './package.json'
|
||||
|
||||
export default defineConfig({
|
||||
base: './',
|
||||
build: { chunkSizeWarningLimit: 1000 },
|
||||
resolve: { alias: { '~': '/src' } },
|
||||
define: {
|
||||
'import.meta.env.version': JSON.stringify(pkgJSON.version),
|
||||
},
|
||||
plugins: [
|
||||
solidPlugin(),
|
||||
|
||||
splitVendorChunkPlugin(),
|
||||
|
||||
VitePWA({
|
||||
|
Loading…
Reference in New Issue
Block a user