fix: fix known issues. fixed #59,fixed #61, fixed #67, fixed #68 [deploy]

This commit is contained in:
vince
2024-07-29 00:19:26 +08:00
parent b98f9f9baa
commit 66fd052709
26 changed files with 163 additions and 155 deletions

View File

@@ -1,5 +1,5 @@
# 应用标题
VITE_GLOB_APP_TITLE=Vben Admin
VITE_APP_TITLE=Vben Admin
# 应用命名空间用于缓存、store等功能的前缀确保隔离
VITE_APP_NAMESPACE=vben-web-antd

View File

@@ -11,8 +11,8 @@
name="viewport"
content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=0"
/>
<!-- 由 vite 注入 VITE_GLOB_APP_TITLE 变量,在 .env 文件内配置 -->
<title><%= VITE_GLOB_APP_TITLE %></title>
<!-- 由 vite 注入 VITE_APP_TITLE 变量,在 .env 文件内配置 -->
<title><%= VITE_APP_TITLE %></title>
<link rel="icon" href="/favicon.ico" />
<script>
// 生产环境下注入百度统计

View File

@@ -1,15 +1,9 @@
import { useAppConfig } from '@vben/hooks';
import { defineOverridesPreferences } from '@vben/preferences';
const { appTitle } = useAppConfig(import.meta.env, import.meta.env.PROD);
/**
* @description 项目配置文件
* 只需要覆盖项目中的一部分配置,不需要的配置不用覆盖,会自动使用默认配置
*/
export const overridesPreferences = defineOverridesPreferences({
// overrides
app: {
name: appTitle,
},
});

View File

@@ -1,24 +1,10 @@
import {
defaultImportmapOptions,
defineConfig,
getDefaultPwaOptions,
loadAndConvertEnv,
} from '@vben/vite-config';
import { defineConfig } from '@vben/vite-config';
export default defineConfig(async () => {
const { appTitle, base, port, ...envConfig } = await loadAndConvertEnv();
return {
application: {
...envConfig,
importmap: false,
importmapOptions: defaultImportmapOptions,
pwa: false,
pwaOptions: getDefaultPwaOptions(appTitle),
},
application: {},
vite: {
base,
server: {
port,
proxy: {
'/api': {
changeOrigin: true,