This commit is contained in:
gyq
2025-10-22 10:34:16 +08:00
parent d99c6bf261
commit 695898484e
20 changed files with 1685 additions and 228 deletions

View File

@@ -13,6 +13,8 @@ import UnoCSS from "unocss/vite";
import { resolve } from "path";
import { name, version, engines, dependencies, devDependencies } from "./package.json";
import stripCode from 'vite-plugin-strip-code'; // 导入插件
// 平台的名称、版本、运行所需的 node 版本、依赖、构建时间的类型提示
const __APP_INFO__ = {
pkg: { name, version, engines, dependencies, devDependencies },
@@ -100,6 +102,12 @@ export default defineConfig(({ mode }: ConfigEnv): UserConfig => {
iconDirs: [resolve(pathSrc, "assets/icons")],
symbolId: "icon-[dir]-[name]",
}),
mode === 'production' && stripCode({
// 定义需要剔除的代码块的「开始标记」和「结束标记」
// 注意:标记可以自定义,只要前后一致即可
start_comment: 'DEV-START', // 开始标记(自定义)
end_comment: 'DEV-END' // 结束标记(自定义)
})
],
// 预加载项目必需的组件
optimizeDeps: {