Compare commits

...

15 Commits

Author SHA1 Message Date
Soybean
376e2f7d84 chore(projects): release v1.2.4 2024-06-14 00:04:43 +08:00
Soybean
069fa8a817 optimize(projects): get buildTime with timezone 'Asia/Shanghai' 2024-06-14 00:00:30 +08:00
Soybean
b5a723cb5f optimize(projects): optimize setupAppVersionNotification 2024-06-13 23:44:41 +08:00
Soybean
79e85bc6b5 chore(projects): release v1.2.3 2024-06-13 23:28:17 +08:00
Soybean
bf7183747b chore(deps): update deps 2024-06-13 23:25:45 +08:00
paynezhuang
aabb2a49c4 fix(projects): Fix secondary directory components is empty (#491) 2024-06-13 23:00:18 +08:00
Soybean
7026126a57 docs(projects): update README 2024-06-13 17:04:50 +08:00
KickCashew
c212565248 fix(projects): fix mobile browser theme issue by adding color-scheme meta tag to index.html (#488) 2024-06-13 14:13:23 +08:00
Soybean
813d8ce4c7 chore(deps): update deps 2024-06-12 21:47:15 +08:00
Azir
20a8127434 docs(projects): Fixed the hyperlink pointing error 2024-06-12 16:54:59 +08:00
Soybean
ec8cadd183 chore(projects): release v1.2.2 2024-06-12 11:09:42 +08:00
Soybean
4470cb4e8c fix(projects): fix menu-toggler hidden in mobile layout. fixed #483 2024-06-12 10:25:11 +08:00
Soybean
8f9a70505c docs(projects): update README 2024-06-12 10:16:16 +08:00
Soybean
9094b21cbb feat(projects): reset scroll position when tab change 2024-06-11 19:04:07 +08:00
Alue Gitman
6259287240 fix(projects): hide AppVersionNotification in DEV mode (#482) 2024-06-07 16:06:33 +08:00
21 changed files with 532 additions and 366 deletions

View File

@@ -1,6 +1,63 @@
# Changelog # Changelog
## [v1.2.4](https://github.com/soybeanjs/soybean-admin/compare/v1.2.3...v1.2.4) (2024-06-14)
###    🛠 Optimizations
- **projects**:
- optimize `setupAppVersionNotification` &nbsp;-&nbsp; by @soybeanjs [<samp>(b5a72)</samp>](https://github.com/soybeanjs/soybean-admin/commit/b5a723c)
- get buildTime with timezone 'Asia/Shanghai' &nbsp;-&nbsp; by @soybeanjs [<samp>(069fa)</samp>](https://github.com/soybeanjs/soybean-admin/commit/069fa8a)
### &nbsp;&nbsp;&nbsp;❤️ Contributors
[![soybeanjs](https://github.com/soybeanjs.png?size=48)](https://github.com/soybeanjs)&nbsp;&nbsp;
## [v1.2.3](https://github.com/soybeanjs/soybean-admin/compare/v1.2.2...v1.2.3) (2024-06-13)
### &nbsp;&nbsp;&nbsp;🐞 Bug Fixes
- **projects**:
- fix mobile browser theme issue by adding color-scheme meta tag to index.html &nbsp;-&nbsp; by @KickCashew in https://github.com/soybeanjs/soybean-admin/issues/488 [<samp>(c2125)</samp>](https://github.com/soybeanjs/soybean-admin/commit/c212565)
- Fix secondary directory components is empty &nbsp;-&nbsp; by @paynezhuang in https://github.com/soybeanjs/soybean-admin/issues/491 [<samp>(aabb2)</samp>](https://github.com/soybeanjs/soybean-admin/commit/aabb2a4)
### &nbsp;&nbsp;&nbsp;📖 Documentation
- **projects**:
- Fixed the hyperlink pointing error &nbsp;-&nbsp; by **Azir** [<samp>(20a81)</samp>](https://github.com/soybeanjs/soybean-admin/commit/20a8127)
- update README &nbsp;-&nbsp; by @soybeanjs [<samp>(70261)</samp>](https://github.com/soybeanjs/soybean-admin/commit/7026126)
### &nbsp;&nbsp;&nbsp;🏡 Chore
- **deps**:
- update deps &nbsp;-&nbsp; by @soybeanjs [<samp>(813d8)</samp>](https://github.com/soybeanjs/soybean-admin/commit/813d8ce)
- update deps &nbsp;-&nbsp; by @soybeanjs [<samp>(bf718)</samp>](https://github.com/soybeanjs/soybean-admin/commit/bf71837)
### &nbsp;&nbsp;&nbsp;❤️ Contributors
[![soybeanjs](https://github.com/soybeanjs.png?size=48)](https://github.com/soybeanjs)&nbsp;&nbsp;[![paynezhuang](https://github.com/paynezhuang.png?size=48)](https://github.com/paynezhuang)&nbsp;&nbsp;[![KickCashew](https://github.com/KickCashew.png?size=48)](https://github.com/KickCashew)&nbsp;&nbsp;
[Azir](mailto:2075125282@qq.com)
## [v1.2.2](https://github.com/honghuangdc/soybean-admin/compare/v1.2.1...v1.2.2) (2024-06-12)
### &nbsp;&nbsp;&nbsp;🚀 Features
- **projects**: reset scroll position when tab change &nbsp;-&nbsp; by @soybeanjs [<samp>(9094b)</samp>](https://github.com/honghuangdc/soybean-admin/commit/9094b21)
### &nbsp;&nbsp;&nbsp;🐞 Bug Fixes
- **projects**:
- hide AppVersionNotification in DEV mode &nbsp;-&nbsp; by @sigma-plus in https://github.com/honghuangdc/soybean-admin/issues/482 [<samp>(62592)</samp>](https://github.com/honghuangdc/soybean-admin/commit/6259287)
- fix menu-toggler hidden in mobile layout. fixed #483 &nbsp;-&nbsp; by @soybeanjs in https://github.com/honghuangdc/soybean-admin/issues/483 [<samp>(4470c)</samp>](https://github.com/honghuangdc/soybean-admin/commit/4470cb4)
### &nbsp;&nbsp;&nbsp;📖 Documentation
- **projects**: update README &nbsp;-&nbsp; by @soybeanjs [<samp>(8f9a7)</samp>](https://github.com/honghuangdc/soybean-admin/commit/8f9a705)
### &nbsp;&nbsp;&nbsp;❤️ Contributors
[![soybeanjs](https://github.com/soybeanjs.png?size=48)](https://github.com/soybeanjs)&nbsp;&nbsp;[![sigma-plus](https://github.com/sigma-plus.png?size=48)](https://github.com/sigma-plus)&nbsp;&nbsp;
## [v1.2.1](https://github.com/honghuangdc/soybean-admin/compare/v1.2.0...v1.2.1) (2024-06-07) ## [v1.2.1](https://github.com/honghuangdc/soybean-admin/compare/v1.2.0...v1.2.1) (2024-06-07)
### &nbsp;&nbsp;&nbsp;🐞 Bug Fixes ### &nbsp;&nbsp;&nbsp;🐞 Bug Fixes

View File

@@ -11,6 +11,9 @@
[![github forks](https://img.shields.io/github/forks/soybeanjs/soybean-admin)](https://github.com/soybeanjs/soybean-admin) [![github forks](https://img.shields.io/github/forks/soybeanjs/soybean-admin)](https://github.com/soybeanjs/soybean-admin)
[![gitee stars](https://gitee.com/honghuangdc/soybean-admin/badge/star.svg)](https://gitee.com/honghuangdc/soybean-admin) [![gitee stars](https://gitee.com/honghuangdc/soybean-admin/badge/star.svg)](https://gitee.com/honghuangdc/soybean-admin)
<a href="https://hellogithub.com/repository/1298f27d5fe54959a16cf9686516ddb3" target="_blank"><img src="https://abroad.hellogithub.com/v1/widgets/recommend.svg?rid=1298f27d5fe54959a16cf9686516ddb3&claim_uid=IiDXWmP4TEntjbV" alt="FeaturedHelloGitHub" style="width: 250px; height: 54px;" width="250" height="54" /></a>
> [!NOTE] > [!NOTE]
> If you think `SoybeanAdmin` is helpful to you, or you like our project, please give us a ⭐️ on GitHub. Your support is the driving force for us to continue to improve and add new features! Thank you for your support! > If you think `SoybeanAdmin` is helpful to you, or you like our project, please give us a ⭐️ on GitHub. Your support is the driving force for us to continue to improve and add new features! Thank you for your support!
@@ -154,10 +157,10 @@ Thanks the following people for their contributions. If you want to contribute t
<p>QQ Group</p> <p>QQ Group</p>
<img src="https://soybeanjs-1300612522.cos.ap-guangzhou.myqcloud.com/uPic/qq-soybean-admin-2.jpg" style="width:200px" /> <img src="https://soybeanjs-1300612522.cos.ap-guangzhou.myqcloud.com/uPic/qq-soybean-admin-2.jpg" style="width:200px" />
</div> </div>
<!-- <div> <div>
<p>WeChat Group</p> <p>WeChat Group</p>
<img src="https://soybeanjs-1300612522.cos.ap-guangzhou.myqcloud.com/uPic/wechat-0402.jpg" style="width:200px" /> <img src="https://soybeanjs-1300612522.cos.ap-guangzhou.myqcloud.com/picgo/soybean-admin-wechat-0620.jpg" style="width:200px" />
</div> --> </div>
<div> <div>
<p>Add the following WeChat to invite to the WeChat group</p> <p>Add the following WeChat to invite to the WeChat group</p>
<img src="https://soybeanjs-1300612522.cos.ap-guangzhou.myqcloud.com/uPic/wechat-soybeanjs.jpg" style="width:200px" /> <img src="https://soybeanjs-1300612522.cos.ap-guangzhou.myqcloud.com/uPic/wechat-soybeanjs.jpg" style="width:200px" />

View File

@@ -1,7 +1,7 @@
<div align="center"> <div align="center">
<img src="./public/favicon.svg" width="160" /> <img src="./public/favicon.svg" width="160" />
<h1>SoybeanAdmin</h1> <h1>SoybeanAdmin</h1>
<span><a href="./README.zh_CN.md">English</a> | 中文</span> <span><a href="./README.md">English</a> | 中文</span>
</div> </div>
--- ---
@@ -11,6 +11,8 @@
[![github forks](https://img.shields.io/github/forks/honghuangdc/soybean-admin)](https://github.com/soybeanjs/soybean-admin) [![github forks](https://img.shields.io/github/forks/honghuangdc/soybean-admin)](https://github.com/soybeanjs/soybean-admin)
[![gitee stars](https://gitee.com/honghuangdc/soybean-admin/badge/star.svg)](https://gitee.com/honghuangdc/soybean-admin) [![gitee stars](https://gitee.com/honghuangdc/soybean-admin/badge/star.svg)](https://gitee.com/honghuangdc/soybean-admin)
<a href="https://hellogithub.com/repository/1298f27d5fe54959a16cf9686516ddb3" target="_blank"><img src="https://abroad.hellogithub.com/v1/widgets/recommend.svg?rid=1298f27d5fe54959a16cf9686516ddb3&claim_uid=IiDXWmP4TEntjbV" alt="FeaturedHelloGitHub" style="width: 250px; height: 54px;" width="250" height="54" /></a>
> [!NOTE] > [!NOTE]
> 如果您觉得 `SoybeanAdmin`对您有所帮助,或者您喜欢我们的项目,请在 GitHub 上给我们一个 ⭐️。您的支持是我们持续改进和增加新功能的动力!感谢您的支持! > 如果您觉得 `SoybeanAdmin`对您有所帮助,或者您喜欢我们的项目,请在 GitHub 上给我们一个 ⭐️。您的支持是我们持续改进和增加新功能的动力!感谢您的支持!
@@ -155,10 +157,10 @@ pnpm build
<p>QQ交流群</p> <p>QQ交流群</p>
<img src="https://soybeanjs-1300612522.cos.ap-guangzhou.myqcloud.com/uPic/qq-soybean-admin-2.jpg" style="width:200px" /> <img src="https://soybeanjs-1300612522.cos.ap-guangzhou.myqcloud.com/uPic/qq-soybean-admin-2.jpg" style="width:200px" />
</div> </div>
<!-- <div> <div>
<p>微信群</p> <p>微信群</p>
<img src="https://soybeanjs-1300612522.cos.ap-guangzhou.myqcloud.com/uPic/wechat-0402.jpg" style="width:200px" /> <img src="https://soybeanjs-1300612522.cos.ap-guangzhou.myqcloud.com/picgo/soybean-admin-wechat-0620.jpg" style="width:200px" />
</div> --> </div>
<div> <div>
<p>添加下面微信邀请进微信群</p> <p>添加下面微信邀请进微信群</p>
<img src="https://soybeanjs-1300612522.cos.ap-guangzhou.myqcloud.com/uPic/wechat-soybeanjs.jpg" style="width:200px" /> <img src="https://soybeanjs-1300612522.cos.ap-guangzhou.myqcloud.com/uPic/wechat-soybeanjs.jpg" style="width:200px" />

View File

@@ -1 +1,2 @@
export * from './proxy'; export * from './proxy';
export * from './time';

12
build/config/time.ts Normal file
View File

@@ -0,0 +1,12 @@
import dayjs from 'dayjs';
import utc from 'dayjs/plugin/utc';
import timezone from 'dayjs/plugin/timezone';
export function getBuildTime() {
dayjs.extend(utc);
dayjs.extend(timezone);
const buildTime = dayjs.tz(Date.now(), 'Asia/Shanghai').format('YYYY-MM-DD HH:mm:ss');
return buildTime;
}

View File

@@ -4,6 +4,7 @@
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<link rel="icon" href="/favicon.svg" /> <link rel="icon" href="/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="color-scheme" content="light dark" />
<title>%VITE_APP_TITLE%</title> <title>%VITE_APP_TITLE%</title>
</head> </head>
<body> <body>

View File

@@ -1,7 +1,7 @@
{ {
"name": "soybean-admin", "name": "soybean-admin",
"type": "module", "type": "module",
"version": "1.2.1", "version": "1.2.4",
"description": "A fresh and elegant admin template, based on Vue3、Vite3、TypeScript、NaiveUI and UnoCSS. 一个基于Vue3、Vite3、TypeScript、NaiveUI and UnoCSS的清新优雅的中后台模版。", "description": "A fresh and elegant admin template, based on Vue3、Vite3、TypeScript、NaiveUI and UnoCSS. 一个基于Vue3、Vite3、TypeScript、NaiveUI and UnoCSS的清新优雅的中后台模版。",
"author": { "author": {
"name": "Soybean", "name": "Soybean",
@@ -53,7 +53,7 @@
"@sa/hooks": "workspace:*", "@sa/hooks": "workspace:*",
"@sa/materials": "workspace:*", "@sa/materials": "workspace:*",
"@sa/utils": "workspace:*", "@sa/utils": "workspace:*",
"@vueuse/core": "10.10.0", "@vueuse/core": "10.11.0",
"clipboard": "2.0.11", "clipboard": "2.0.11",
"dayjs": "1.11.11", "dayjs": "1.11.11",
"echarts": "5.5.0", "echarts": "5.5.0",
@@ -61,44 +61,44 @@
"naive-ui": "2.38.2", "naive-ui": "2.38.2",
"nprogress": "0.2.0", "nprogress": "0.2.0",
"pinia": "2.1.7", "pinia": "2.1.7",
"tailwind-merge": "^2.3.0", "tailwind-merge": "2.3.0",
"vue": "3.4.27", "vue": "3.4.27",
"vue-draggable-plus": "0.5.0", "vue-draggable-plus": "0.5.0",
"vue-i18n": "9.13.1", "vue-i18n": "9.13.1",
"vue-router": "4.3.2" "vue-router": "4.3.3"
}, },
"devDependencies": { "devDependencies": {
"@elegant-router/vue": "0.3.7", "@elegant-router/vue": "0.3.7",
"@iconify/json": "2.2.217", "@iconify/json": "2.2.218",
"@sa/scripts": "workspace:*", "@sa/scripts": "workspace:*",
"@sa/uno-preset": "workspace:*", "@sa/uno-preset": "workspace:*",
"@soybeanjs/eslint-config": "1.3.6", "@soybeanjs/eslint-config": "1.3.6",
"@types/lodash-es": "4.17.12", "@types/lodash-es": "4.17.12",
"@types/node": "20.14.2", "@types/node": "20.14.2",
"@types/nprogress": "0.2.3", "@types/nprogress": "0.2.3",
"@unocss/eslint-config": "0.60.4", "@unocss/eslint-config": "0.61.0",
"@unocss/preset-icons": "0.60.4", "@unocss/preset-icons": "0.61.0",
"@unocss/preset-uno": "0.60.4", "@unocss/preset-uno": "0.61.0",
"@unocss/transformer-directives": "0.60.4", "@unocss/transformer-directives": "0.61.0",
"@unocss/transformer-variant-group": "0.60.4", "@unocss/transformer-variant-group": "0.61.0",
"@unocss/vite": "0.60.4", "@unocss/vite": "0.61.0",
"@vitejs/plugin-vue": "5.0.5", "@vitejs/plugin-vue": "5.0.5",
"@vitejs/plugin-vue-jsx": "4.0.0", "@vitejs/plugin-vue-jsx": "4.0.0",
"eslint": "9.4.0", "eslint": "9.4.0",
"eslint-plugin-vue": "9.26.0", "eslint-plugin-vue": "9.26.0",
"lint-staged": "15.2.5", "lint-staged": "15.2.7",
"sass": "1.77.4", "sass": "1.77.5",
"simple-git-hooks": "2.11.1", "simple-git-hooks": "2.11.1",
"tsx": "4.12.0", "tsx": "4.15.4",
"typescript": "5.4.5", "typescript": "5.4.5",
"unplugin-icons": "0.19.0", "unplugin-icons": "0.19.0",
"unplugin-vue-components": "0.27.0", "unplugin-vue-components": "0.27.0",
"vite": "5.2.12", "vite": "5.3.0",
"vite-plugin-progress": "0.0.7", "vite-plugin-progress": "0.0.7",
"vite-plugin-svg-icons": "2.0.1", "vite-plugin-svg-icons": "2.0.1",
"vite-plugin-vue-devtools": "7.2.1", "vite-plugin-vue-devtools": "7.2.1",
"vue-eslint-parser": "9.4.3", "vue-eslint-parser": "9.4.3",
"vue-tsc": "2.0.19" "vue-tsc": "2.0.21"
}, },
"simple-git-hooks": { "simple-git-hooks": {
"commit-msg": "pnpm sa git-commit-verify", "commit-msg": "pnpm sa git-commit-verify",

View File

@@ -1,6 +1,6 @@
{ {
"name": "@sa/axios", "name": "@sa/axios",
"version": "1.2.1", "version": "1.2.4",
"exports": { "exports": {
".": "./src/index.ts" ".": "./src/index.ts"
}, },

View File

@@ -1,6 +1,6 @@
{ {
"name": "@sa/color", "name": "@sa/color",
"version": "1.2.1", "version": "1.2.4",
"exports": { "exports": {
".": "./src/index.ts" ".": "./src/index.ts"
}, },

View File

@@ -1,6 +1,6 @@
{ {
"name": "@sa/hooks", "name": "@sa/hooks",
"version": "1.2.1", "version": "1.2.4",
"exports": { "exports": {
".": "./src/index.ts" ".": "./src/index.ts"
}, },

View File

@@ -1,6 +1,6 @@
{ {
"name": "@sa/materials", "name": "@sa/materials",
"version": "1.2.1", "version": "1.2.4",
"exports": { "exports": {
".": "./src/index.ts" ".": "./src/index.ts"
}, },

View File

@@ -1,6 +1,6 @@
{ {
"name": "@sa/fetch", "name": "@sa/fetch",
"version": "1.2.1", "version": "1.2.4",
"exports": { "exports": {
".": "./src/index.ts" ".": "./src/index.ts"
}, },

View File

@@ -1,6 +1,6 @@
{ {
"name": "@sa/scripts", "name": "@sa/scripts",
"version": "1.2.1", "version": "1.2.4",
"bin": { "bin": {
"sa": "./bin.ts" "sa": "./bin.ts"
}, },

View File

@@ -1,6 +1,6 @@
{ {
"name": "@sa/uno-preset", "name": "@sa/uno-preset",
"version": "1.2.1", "version": "1.2.4",
"exports": { "exports": {
".": "./src/index.ts" ".": "./src/index.ts"
}, },

View File

@@ -1,6 +1,6 @@
{ {
"name": "@sa/utils", "name": "@sa/utils",
"version": "1.2.1", "version": "1.2.4",
"exports": { "exports": {
".": "./src/index.ts" ".": "./src/index.ts"
}, },

731
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -41,6 +41,7 @@ const icon = computed(() => {
<template> <template>
<ButtonIcon <ButtonIcon
:key="String(collapsed)"
:tooltip-content="collapsed ? $t('icon.expand') : $t('icon.collapse')" :tooltip-content="collapsed ? $t('icon.expand') : $t('icon.collapse')"
tooltip-placement="bottom-start" tooltip-placement="bottom-start"
:z-index="zIndex" :z-index="zIndex"

View File

@@ -1,5 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import { computed } from 'vue'; import { computed } from 'vue';
import { LAYOUT_SCROLL_EL_ID } from '@sa/materials';
import { useAppStore } from '@/store/modules/app'; import { useAppStore } from '@/store/modules/app';
import { useThemeStore } from '@/store/modules/theme'; import { useThemeStore } from '@/store/modules/theme';
import { useRouteStore } from '@/store/modules/route'; import { useRouteStore } from '@/store/modules/route';
@@ -24,6 +25,12 @@ const routeStore = useRouteStore();
const tabStore = useTabStore(); const tabStore = useTabStore();
const transitionName = computed(() => (themeStore.page.animate ? themeStore.page.animateMode : '')); const transitionName = computed(() => (themeStore.page.animate ? themeStore.page.animateMode : ''));
function resetScroll() {
const el = document.querySelector(`#${LAYOUT_SCROLL_EL_ID}`);
el?.scrollTo({ left: 0, top: 0 });
}
</script> </script>
<template> <template>
@@ -32,6 +39,7 @@ const transitionName = computed(() => (themeStore.page.animate ? themeStore.page
:name="transitionName" :name="transitionName"
mode="out-in" mode="out-in"
@before-leave="appStore.setContentXScrollable(true)" @before-leave="appStore.setContentXScrollable(true)"
@after-leave="resetScroll"
@after-enter="appStore.setContentXScrollable(false)" @after-enter="appStore.setContentXScrollable(false)"
> >
<KeepAlive :include="routeStore.cacheRoutes"> <KeepAlive :include="routeStore.cacheRoutes">

View File

@@ -3,10 +3,18 @@ import { NButton } from 'naive-ui';
import { $t } from '../locales'; import { $t } from '../locales';
export function setupAppVersionNotification() { export function setupAppVersionNotification() {
let isShow = false;
document.addEventListener('visibilitychange', async () => { document.addEventListener('visibilitychange', async () => {
const preConditions = [!isShow, document.visibilityState === 'visible', !import.meta.env.DEV];
if (!preConditions.every(Boolean)) return;
const buildTime = await getHtmlBuildTime(); const buildTime = await getHtmlBuildTime();
if (buildTime !== BUILD_TIME && document.visibilityState === 'visible') { if (buildTime !== BUILD_TIME) {
isShow = true;
const n = window.$notification?.create({ const n = window.$notification?.create({
title: $t('system.updateTitle'), title: $t('system.updateTitle'),
content: $t('system.updateContent'), content: $t('system.updateContent'),
@@ -32,6 +40,9 @@ export function setupAppVersionNotification() {
() => $t('system.updateConfirm') () => $t('system.updateConfirm')
) )
]); ]);
},
onClose() {
isShow = false;
} }
}); });
} }

View File

@@ -6,7 +6,7 @@ export function getLayoutAndPage(component?: string | null) {
let layout = ''; let layout = '';
let page = ''; let page = '';
const [layoutOrPage, pageItem] = component?.split(FIRST_LEVEL_ROUTE_COMPONENT_SPLIT) || []; const [layoutOrPage = '', pageItem = ''] = component?.split(FIRST_LEVEL_ROUTE_COMPONENT_SPLIT) || [];
layout = getLayout(layoutOrPage); layout = getLayout(layoutOrPage);
page = getPage(pageItem || layoutOrPage); page = getPage(pageItem || layoutOrPage);

View File

@@ -1,14 +1,13 @@
import process from 'node:process'; import process from 'node:process';
import { URL, fileURLToPath } from 'node:url'; import { URL, fileURLToPath } from 'node:url';
import { defineConfig, loadEnv } from 'vite'; import { defineConfig, loadEnv } from 'vite';
import dayjs from 'dayjs';
import { setupVitePlugins } from './build/plugins'; import { setupVitePlugins } from './build/plugins';
import { createViteProxy } from './build/config'; import { createViteProxy, getBuildTime } from './build/config';
export default defineConfig(configEnv => { export default defineConfig(configEnv => {
const viteEnv = loadEnv(configEnv.mode, process.cwd()) as unknown as Env.ImportMeta; const viteEnv = loadEnv(configEnv.mode, process.cwd()) as unknown as Env.ImportMeta;
const buildTime = dayjs().format('YYYY-MM-DD HH:mm:ss'); const buildTime = getBuildTime();
return { return {
base: viteEnv.VITE_BASE_URL, base: viteEnv.VITE_BASE_URL,