fix: 修复 Vite allow list 错误
This commit is contained in:
3
web/src/app.d.ts
vendored
3
web/src/app.d.ts
vendored
@@ -8,6 +8,9 @@ declare global {
|
||||
// interface PageState {}
|
||||
// interface Platform {}
|
||||
}
|
||||
|
||||
// Vite 注入的全局变量
|
||||
const __APP_VERSION__: string;
|
||||
}
|
||||
|
||||
export {};
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
// 版本号配置
|
||||
// 更新版本时需要手动修改此文件
|
||||
export const VERSION = '1.3.0';
|
||||
@@ -27,8 +27,8 @@
|
||||
import Sparkles from '@lucide/svelte/icons/sparkles';
|
||||
import Info from '@lucide/svelte/icons/info';
|
||||
|
||||
// 版本号
|
||||
import { VERSION } from '$lib/version';
|
||||
// 版本号(从 Vite 编译时注入)
|
||||
const appVersion = __APP_VERSION__;
|
||||
|
||||
// Theme
|
||||
import {
|
||||
@@ -248,7 +248,7 @@
|
||||
title="查看更新日志"
|
||||
>
|
||||
<Info class="size-4" />
|
||||
<span class="text-xs">v{VERSION}</span>
|
||||
<span class="text-xs">v{appVersion}</span>
|
||||
</button>
|
||||
{/snippet}
|
||||
</Sidebar.MenuButton>
|
||||
|
||||
@@ -2,10 +2,18 @@ import { defineConfig } from 'vitest/config';
|
||||
import { playwright } from '@vitest/browser-playwright';
|
||||
import { sveltekit } from '@sveltejs/kit/vite';
|
||||
import tailwindcss from '@tailwindcss/vite';
|
||||
import { readFileSync } from 'fs';
|
||||
import { fileURLToPath } from 'url';
|
||||
|
||||
const pkg = JSON.parse(readFileSync(new URL('./package.json', import.meta.url), 'utf-8'));
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [sveltekit(), tailwindcss()],
|
||||
|
||||
define: {
|
||||
__APP_VERSION__: JSON.stringify(pkg.version)
|
||||
},
|
||||
|
||||
server: {
|
||||
proxy: {
|
||||
'/api': {
|
||||
|
||||
Reference in New Issue
Block a user