chore: update vite 4.2

pull/46/MERGE
xingyuv 2023-03-23 09:42:01 +08:00
parent 69acb5bb33
commit e6ccfbddb6
3 changed files with 5 additions and 7 deletions

View File

@ -15,7 +15,7 @@ import vueSetupExtend from 'vite-plugin-vue-setup-extend'
import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite' import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite'
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons' import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
export function createVitePlugins(VITE_APP_TITLE: string) { export function createVitePlugins() {
const root = process.cwd() const root = process.cwd()
// 路径查找 // 路径查找
function pathResolve(dir: string) { function pathResolve(dir: string) {
@ -95,8 +95,6 @@ export function createVitePlugins(VITE_APP_TITLE: string) {
ext: '.gz', // 生成的压缩包后缀 ext: '.gz', // 生成的压缩包后缀
deleteOriginFile: false //压缩后是否删除源文件 deleteOriginFile: false //压缩后是否删除源文件
}), }),
ViteEjsPlugin({ ViteEjsPlugin()
title: VITE_APP_TITLE
})
] ]
} }

View File

@ -13,7 +13,7 @@
name="description" name="description"
content="芋道管理系统 基于 vue3 + CompositionAPI + typescript + vite3 + element plus 的后台开源免费管理系统!" content="芋道管理系统 基于 vue3 + CompositionAPI + typescript + vite3 + element plus 的后台开源免费管理系统!"
/> />
<title><%= title %></title> <title>%VITE_APP_TITLE%</title>
</head> </head>
<body> <body>
<div id="app"> <div id="app">
@ -137,7 +137,7 @@
<div class="app-loading-wrap"> <div class="app-loading-wrap">
<div class="app-loading-title"> <div class="app-loading-title">
<img src="/logo.gif" class="app-loading-logo" alt="Logo" /> <img src="/logo.gif" class="app-loading-logo" alt="Logo" />
<div class="app-loading-title"><%= title %></div> <div class="app-loading-title">%VITE_APP_TITLE%</div>
</div> </div>
<div class="app-loading-item"> <div class="app-loading-item">
<div class="app-loading-outter"></div> <div class="app-loading-outter"></div>

View File

@ -42,7 +42,7 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
// }, // },
}, },
// 项目使用的vite插件。 单独提取到build/vite/plugin中管理 // 项目使用的vite插件。 单独提取到build/vite/plugin中管理
plugins: createVitePlugins(env.VITE_APP_TITLE), plugins: createVitePlugins(),
css: { css: {
preprocessorOptions: { preprocessorOptions: {
scss: { scss: {