revert: 简化构建步骤,撤销app.config.js功能

This commit is contained in:
张传龙
2022-06-25 14:45:23 +08:00
parent 1fa9d4d472
commit b7ce7912a7
12 changed files with 18 additions and 68 deletions

View File

@@ -1,14 +1,7 @@
import { createHtmlPlugin } from 'vite-plugin-html'
import { version } from '../../package.json'
import { GLOB_CONFIG_FILE_NAME } from '../constant'
export function configHtmlPlugin(viteEnv, isBuild) {
const { VITE_APP_TITLE, VITE_PUBLIC_PATH } = viteEnv
const path = VITE_PUBLIC_PATH.endsWith('/') ? VITE_PUBLIC_PATH : `${VITE_PUBLIC_PATH}/`
const getAppConfigSrc = () => {
return `${path}${GLOB_CONFIG_FILE_NAME}?v=${version}-${new Date().getTime()}`
}
const htmlPlugin = createHtmlPlugin({
minify: isBuild,
@@ -16,16 +9,6 @@ export function configHtmlPlugin(viteEnv, isBuild) {
data: {
title: VITE_APP_TITLE,
},
tags: isBuild
? [
{
tag: 'script',
attrs: {
src: getAppConfigSrc(),
},
},
]
: [],
},
})
return htmlPlugin