🎨 更新用户版本

This commit is contained in:
2025-09-02 22:56:30 +08:00
parent 8276b3e87f
commit a1906d2a36
71 changed files with 4790 additions and 962 deletions

View File

@@ -1,4 +1,5 @@
import legacyPlugin from '@vitejs/plugin-legacy'
import { viteLogo } from './src/core/config'
import Banner from 'vite-plugin-banner'
import * as path from 'path'
import * as dotenv from 'dotenv'
@@ -8,6 +9,8 @@ import vueDevTools from 'vite-plugin-vue-devtools'
import VueFilePathPlugin from './vitePlugin/componentName/index.js'
import { svgBuilder } from 'vite-auto-import-svg'
import { AddSecret } from './vitePlugin/secret'
import UnoCSS from '@unocss/vite'
// @see https://cn.vitejs.dev/config/
export default ({ mode }) => {
AddSecret('')
@@ -20,6 +23,8 @@ export default ({ mode }) => {
}
}
viteLogo(process.env)
const timestamp = Date.parse(new Date())
const optimizeDeps = {}
@@ -39,9 +44,13 @@ export default ({ mode }) => {
}
}
const base = "/"
const root = "./"
const outDir = "dist"
const config = {
base: '/', // 编译后js导入的资源路径
root: './', // index.html文件所在位置
base: base, // 编译后js导入的资源路径
root: root, // index.html文件所在位置
publicDir: 'public', // 静态资源文件夹
resolve: {
alias
@@ -70,14 +79,13 @@ export default ({ mode }) => {
rewrite: (path) =>
path.replace(new RegExp('^' + process.env.VITE_BASE_API), '')
}
},
allowedHosts: ['all','lckt.echol.top','lckt.hnlc5588.cn'],
}
},
build: {
minify: 'terser', // 是否进行压缩,boolean | 'terser' | 'esbuild',默认使用terser
manifest: false, // 是否产出manifest.json
sourcemap: false, // 是否产出sourcemap.json
outDir: 'dist', // 产出目录
outDir: outDir, // 产出目录
terserOptions: {
compress: {
//生产环境时移除console
@@ -103,10 +111,10 @@ export default ({ mode }) => {
]
}),
vuePlugin(),
svgBuilder('./src/assets/icons/'),
svgBuilder('./src/plugin/'),
svgBuilder(['./src/plugin/','./src/assets/icons/'],base, outDir,'assets', NODE_ENV),
[Banner(`\n Build based on gin-vue-admin \n Time : ${timestamp}`)],
VueFilePathPlugin('./src/pathInfo.json')
VueFilePathPlugin('./src/pathInfo.json'),
UnoCSS()
]
}
return config