This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
# 应用标题
|
||||
VITE_GLOB_APP_TITLE=Vben Admin
|
||||
VITE_APP_TITLE=Vben Admin
|
||||
|
||||
# 应用命名空间,用于缓存、store等功能的前缀,确保隔离
|
||||
VITE_APP_NAMESPACE=vben-web-antd
|
||||
|
@@ -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>
|
||||
// 生产环境下注入百度统计
|
||||
|
@@ -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,
|
||||
},
|
||||
});
|
||||
|
@@ -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,
|
||||
|
Reference in New Issue
Block a user