更新记录
0.1.5(2026-06-06) 下载此版本
新增 autoImport 自动导入插件,精简 Common 工具模块(移除 compress、object、path),修复 dts 类型声明文件在开发模式下不生成的问题
autoImport(新增)
自动导入插件,在 Vite 构建过程中自动检测代码中使用的标识符,并将对应的 import 语句注入到文件顶部,无需手动编写 import 声明。enforce: 'post'。
功能特性:
- 预设映射:通过
imports配置常用库的自动导入规则,支持简写格式(Record<string, string[]>)和完整格式(ImportMapping[],支持默认导入) - 目录扫描:通过
dirs配置自动扫描指定目录下的模块导出,递归扫描子目录,跳过node_modules和隐藏目录 - Vue 模板支持:
vueTemplate开启后,Vue SFC<template>中使用的 API 也会被自动导入 - 类型声明生成:
dts选项自动生成.d.ts类型声明文件,提供 IDE 类型提示 - 标识符忽略:
ignore选项排除不需要自动导入的标识符 - 文件过滤:
fileFilter正则控制需要处理的文件范围 - 注入位置:
injectAtPosition支持'top'(文件顶部)和'after-last-import'(最后一个 import 之后)两种位置
配置选项:
| 选项 | 类型 | 默认值 | 描述 |
|---|---|---|---|
| imports | Record<string, string[]> | ImportMapping[] | Array<...> |
{} |
导入映射配置 |
| dirs | string[] |
[] |
需要扫描的目录列表 |
| dts | string | boolean |
'auto-imports.d.ts' |
类型声明文件输出路径,false 不生成 |
| vueTemplate | boolean |
false |
是否为 Vue 模板启用自动导入 |
| ignore | string[] |
[] |
需要忽略的标识符列表 |
| fileFilter | RegExp |
/\.(vue\|jsx\|tsx\|ts\|js\|mjs)$/ |
文件过滤正则表达式 |
| injectAtPosition | 'top' | 'after-last-import' |
'top' |
import 语句注入位置 |
ImportMapping 类型:
| 属性 | 类型 | 描述 |
|---|---|---|
| module | string |
模块路径 |
| names | string[] |
要导入的名称列表 |
| defaultImport | boolean |
是否为默认导入,默认 false |
ResolvedImport 类型:
| 属性 | 类型 | 描述 |
|---|---|---|
| module | string |
模块路径 |
| name | string |
导入标识符名称 |
| isDefault | boolean |
是否为默认导入 |
ScannedModule 类型:
| 属性 | 类型 | 描述 |
|---|---|---|
| filePath | string |
模块文件的绝对路径 |
| exports | string[] |
命名导出名称列表 |
| defaultExport | string | null |
默认导出名称,无则为 null |
TransformResult 类型:
| 属性 | 类型 | 描述 |
|---|---|---|
| code | string |
转换后的代码字符串 |
| map | any |
Source map 信息(可选) |
Common 工具模块(精简)
移除使用次数不足 2 次的工具模块,仅保留在多处被复用的核心工具:
- 移除
@common/compress—calculateGzipSize仅在bundleAnalyzer中使用,已内联 - 移除
@common/object—deepMerge仅在loadingManager中使用,已内联 - 移除
@common/path—isNodeModule仅在bundleAnalyzer中使用,已内联
保留的 6 个模块:
| 子路径 | 描述 | 导出内容 |
|---|---|---|
common/format |
格式化工具 | getDateFormatParams、formatFileSize、DateFormatOptions |
common/fs |
文件系统工具 | checkSourceExists、copySourceToTarget、writeFileContent、scanDirectory、writeJsonReport 及相关类型 |
common/html |
HTML 注入工具 | injectBeforeTag、injectHeadAndBody、sanitizeContent 及相关类型 |
common/script |
脚本生成工具 | makeCallback |
common/ui |
终端 UI 工具 | ANSI |
common/validation |
参数验证工具 | Validator、validateGlobalName、validateNoScriptInTemplate、validateCallbackFields |
子路径导出(变更)
- 新增
@meng-xi/vite-plugin/plugins/auto-import子路径导出 - 新增导出函数:
autoImport - 新增导出类型:
AutoImportOptions、ImportMapping、ResolvedImport、ScannedModule、TransformResult - 移除
@meng-xi/vite-plugin/common/compress子路径导出 - 移除
@meng-xi/vite-plugin/common/object子路径导出 - 移除
@meng-xi/vite-plugin/common/path子路径导出 @meng-xi/vite-plugin/common移除导出:calculateGzipSize、deepMerge、isNodeModule、SPINNER_FRAMES、stripAnsi、escapeHtmlAttr、getExtension、padNumber、generateRandomHash、formatDate、parseTemplate、toCamelCase、toPascalCase、stripJsonComments及相关类型
0.1.4(2026-06-03) 下载此版本
新增 envGuard 环境变量校验插件,新增 @common/ui 终端 UI 工具模块
envGuard(新增)
环境变量校验插件,在 Vite 构建前校验环境变量的存在性和合法性,支持多种值类型校验、正则匹配、自定义校验函数、范围约束和长度约束,可选生成 .env 模板文件和注入运行时守卫代码。enforce: 'post'(运行时守卫注入)。
功能特性:
- 多类型校验:
string、number、url、boolean、enum、json、semver、path - 范围验证:
minValue/maxValue数值范围约束(number类型) - 长度验证:
minLength/maxLength字符串长度约束(字符串类类型) - 正则匹配:
pattern正则表达式校验 - 自定义校验:
validator函数,返回true或错误消息字符串 - 失败处理:
failAction支持error(中断构建)、warn(警告继续)、ignore(静默忽略) - .env 模板生成:
generateTemplate自动生成含注释、分组、敏感标记的模板文件 - 运行时守卫:
runtimeGuard注入 JavaScript 代码到 HTML,支持console(控制台警告)、throw(抛出错误)、overlay(页面横幅)三种模式 - 自动加载 .env:
autoLoadEnv按配置路径自动加载环境变量到process.env - 校验报告:
reportOutput生成 JSON 格式的校验结果报告 - 校验摘要:
showSummary在终端输出通过/缺失/失败统计
配置选项:
| 选项 | 类型 | 默认值 | 描述 |
|---|---|---|---|
| required | Record<string, EnvFieldRule> |
{} |
环境变量校验规则映射 |
| failAction | 'error' | 'warn' | 'ignore' |
'error' |
校验失败时的处理动作 |
| generateTemplate | boolean |
true |
是否自动生成 .env 模板文件 |
| templateOutput | string |
'.env.template' |
.env 模板文件的输出路径 |
| runtimeGuard | boolean |
false |
是否注入运行时环境变量守卫代码 |
| runtimeGlobalName | string |
'__ENV_GUARD__' |
运行时守卫的全局变量名 |
| runtimeGuardMode | 'console' | 'throw' | 'overlay' |
'console' |
运行时守卫的行为模式 |
| envFiles | string[] |
['.env', '.env.local', '.env.production', '.env.development'] |
需要加载的 .env 文件路径列表 |
| autoLoadEnv | boolean |
true |
是否自动加载 .env 文件到 process.env |
| reportOutput | string | false |
false |
校验报告输出路径,false 不生成 |
| validateBeforeBuild | boolean |
true |
是否在构建前执行校验 |
| showSummary | boolean |
true |
是否输出校验摘要日志 |
EnvFieldRule 类型:
| 属性 | 类型 | 描述 |
|---|---|---|
| type | EnvType |
值类型,默认 'string' |
| required | boolean |
是否为必需字段,默认 true |
| pattern | RegExp |
正则表达式,值必须匹配此模式 |
| validator | (value: string) => boolean \| string |
自定义验证函数 |
| message | string |
自定义错误消息 |
| default | string |
当值为空时使用的默认值 |
| enumValues | string[] |
枚举值列表(仅 enum 类型) |
| minValue | number |
数值最小值(仅 number 类型) |
| maxValue | number |
数值最大值(仅 number 类型) |
| minLength | number |
字符串最小长度(仅字符串类类型) |
| maxLength | number |
字符串最大长度(仅字符串类类型) |
| group | string |
变量分组名称,用于模板生成时的分组显示 |
| description | string |
变量描述信息,用于模板生成时的说明文本 |
| sensitive | boolean |
是否为敏感变量,模板中会隐藏实际值 |
EnvValidationResult 类型:
| 属性 | 类型 | 描述 |
|---|---|---|
| key | string |
环境变量名 |
| status | 'pass' | 'missing' | 'type_error' | 'custom_error' | 'enum_mismatch' | 'range_error' | 'length_error' |
验证状态 |
| message | string |
验证消息 |
| value | string | undefined |
环境变量的有效值 |
| rule | EnvFieldRule |
应用的校验规则 |
EnvGuardResult 类型:
| 属性 | 类型 | 描述 |
|---|---|---|
| timestamp | string |
校验时间戳(ISO 格式) |
| total | number |
校验的环境变量总数 |
| passed | number |
校验通过的变量数量 |
| missing | number |
缺失的必需变量数量 |
| invalid | number |
校验失败的变量数量 |
| results | EnvValidationResult[] |
所有变量的详细校验结果列表 |
| allPassed | boolean |
是否所有变量均校验通过 |
@common/ui(新增模块)
终端 UI 工具模块,提供 ANSI 转义码处理、Spinner 动画帧和字符串清理等工具函数。
ANSI— ANSI 转义码工具集,包含光标控制(reset、clearLine、hideCursor、showCursor)和彩色文本包装(green、cyan、gray、bold、red、yellow、magenta)SPINNER_FRAMES— Spinner 动画帧序列,Windows 平台使用 ASCII 字符|///-/\,其他平台使用 Unicode Braille 字符⠋-⠏stripAnsi(str)— 移除字符串中的所有 ANSI 转义码,用于计算文本实际显示宽度或将彩色输出转为纯文本
@common/validation(增强)
新增环境变量验证相关类型和函数:
EnvType类型 — 环境变量值类型,支持'string'|'number'|'url'|'boolean'|'enum'|'json'|'semver'|'path'EnvFieldRule接口 — 环境变量字段校验规则,包含类型约束、范围限制、自定义验证函数和元数据信息EnvValidationResult接口 — 环境变量验证结果,包含验证状态、错误消息和有效值STRING_LIKE_TYPES常量 — 字符串类类型集合,用于长度验证时判断是否需要检查minLength/maxLengthvalidateType(value, rule)— 验证环境变量值的类型validateRange(value, rule)— 验证数值范围(仅number类型)validateLength(value, rule)— 验证字符串长度(仅字符串类类型)validateValue(key, value, rule)— 验证单个环境变量值(按顺序执行缺失检查、类型验证、范围验证、长度验证、正则验证、自定义验证)validateEnvironment(env, rules)— 批量验证环境变量
子路径导出(增强)
@meng-xi/vite-plugin/plugins新增导出类型:EnvGuardOptions、EnvGuardResult、EnvFailAction、RuntimeGuardMode@meng-xi/vite-plugin/plugins新增导出函数:envGuard@meng-xi/vite-plugin/common/ui新增子路径导出,包含ANSI、SPINNER_FRAMES、stripAnsi@meng-xi/vite-plugin/common新增导出:ANSI、SPINNER_FRAMES、stripAnsi、EnvType、EnvFieldRule、EnvValidationResult、STRING_LIKE_TYPES、validateType、validateRange、validateLength、validateValue、validateEnvironment
0.1.3(2026-06-01) 下载此版本
新增 bundleAnalyzer 构建产物体积分析插件,新增 @common/compress 和 @common/path 工具模块,@common/format 和 @common/fs 新增通用函数
bundleAnalyzer(新增)
构建产物体积分析插件,在 Vite 构建(writeBundle)完成后自动扫描输出目录,分析构建产物的体积分布、模块依赖、文件类型统计等关键指标,生成 JSON 报告和/或包含可视化图表的 HTML 报告,支持体积阈值告警和与上次构建的对比分析。enforce: 'post'。
功能特性:
- 多格式报告输出:
json(JSON 格式)、html(含可视化图表的 HTML)、both(同时生成两种) - 体积分析:计算原始大小和 gzip 压缩大小,使用最高压缩级别(level: 9)
- 阈值告警:超过
sizeThreshold的 chunk 自动产生告警,超过 2 倍阈值标记为 critical - 构建对比:与历史报告对比体积变化趋势,显示增大、减小、新增、移除的模块
- 可视化图表:HTML 报告支持 treemap(树状图)、sunburst(旭日图)和 list(列表)三种视图
- 模块排行:Top N 大模块排行,区分源码和 node_modules
- 文件类型分布:按扩展名统计体积占比
- 自动打开:
openAnalyzer支持跨平台自动在浏览器中打开 HTML 报告 - 分析摘要日志:构建完成后输出 chunk 数量、总体积、gzip 体积、Top 5 模块
配置选项:
| 选项 | 类型 | 默认值 | 描述 |
|---|---|---|---|
| outputFormat | 'json' | 'html' | 'both' |
'json' |
报告输出格式 |
| outputFile | string |
'bundle-analysis' |
报告输出文件名(不含扩展名) |
| openAnalyzer | boolean |
false |
是否在生成 HTML 报告后自动打开浏览器 |
| sizeThreshold | number |
100 |
体积告警阈值(KB) |
| topModules | number |
20 |
Top N 大模块排行数量 |
| compareWith | string | null |
null |
用于对比的历史报告路径 |
| gzipSize | boolean |
true |
是否计算 gzip 大小 |
| excludeNodeModules | boolean |
false |
是否排除 node_modules 中的模块 |
| excludePatterns | string[] |
[] |
需要排除的文件路径模式列表 |
| includeExtensions | string[] |
[] |
需要包含的文件扩展名列表,为空则包含所有 |
| defaultChartType | 'treemap' | 'sunburst' | 'list' |
'treemap' |
HTML 报告中图表的默认展示形式 |
BundleAnalysisResult 类型:
| 属性 | 类型 | 描述 |
|---|---|---|
| timestamp | string |
分析时间戳(ISO 格式) |
| totalSize | number |
构建产物总大小(字节) |
| totalGzipSize | number |
gzip 总大小(字节) |
| chunks | ChunkStats[] |
chunk 统计列表 |
| topModules | ModuleStats[] |
Top N 大模块 |
| fileTypeDistribution | FileTypeDistribution[] |
文件类型分布统计 |
| warnings | SizeWarning[] |
体积阈值告警列表 |
| comparisonDiffs | ComparisonDiff[] |
构建对比差异列表 |
| analysisTime | number |
分析耗时(毫秒) |
ChunkStats 类型:
| 属性 | 类型 | 描述 |
|---|---|---|
| name | string |
chunk 名称 |
| size | number |
原始大小(字节) |
| gzipSize | number |
gzip 压缩大小(字节) |
| modules | ModuleStats[] |
包含的模块列表 |
| type | 'entry' | 'chunk' | 'asset' |
chunk 类型 |
| fileCount | number |
包含的文件数量 |
ModuleStats 类型:
| 属性 | 类型 | 描述 |
|---|---|---|
| id | string |
模块标识符(通常是模块路径或 ID) |
| size | number |
模块原始大小(字节) |
| gzipSize | number |
模块 gzip 压缩后大小(字节) |
| chunks | string[] |
所属 chunk 名称列表 |
| imports | string[] |
依赖模块 ID 列表 |
| isEntry | boolean |
是否为入口模块 |
| isNodeModule | boolean |
是否来自 node_modules |
FileTypeDistribution 类型:
| 属性 | 类型 | 描述 |
|---|---|---|
| extension | string |
文件扩展名(如 .js) |
| count | number |
该类型的文件数量 |
| totalSize | number |
该类型的总大小(字节) |
| percentage | number |
该类型的总体积占比(0-100) |
SizeWarning 类型:
| 属性 | 类型 | 描述 |
|---|---|---|
| level | 'module' | 'chunk' |
告警级别 |
| name | string |
告警目标名称 |
| sizeKB | number |
实际大小(KB) |
| thresholdKB | number |
阈值大小(KB) |
| message | string |
告警消息 |
ComparisonDiff 类型:
| 属性 | 类型 | 描述 |
|---|---|---|
| name | string |
模块/chunk 名称 |
| previousSize | number |
上次构建大小 |
| currentSize | number |
本次构建大小 |
| diff | number |
体积变化量 |
| diffPercentage | number |
变化百分比 |
| trend | 'increased' | 'decreased' | 'unchanged' | 'added' | 'removed' |
变化趋势 |
@common/compress(新增模块)
calculateGzipSize(data)— 计算给定数据的 gzip 压缩后大小(异步),使用最高压缩级别(level: 9),用于估算网络传输体积。参数data支持Buffer和string类型
@common/path(新增模块)
isNodeModule(moduleId)— 判断模块 ID 是否来自 node_modules。检测规则:路径包含node_modules、以\0开头(Rollup 内部虚拟模块)、以virtual:开头(虚拟模块前缀)
@common/format(增强)
新增以下工具函数:
escapeHtmlAttr(str)— 转义 HTML 属性值中的特殊字符,防止 XSS 注入。将&、"、<、>分别转义为&、"、<、>formatFileSize(bytes)— 将字节数格式化为人类可读的文件大小字符串。小于 1KB 显示xB,小于 1MB 显示x.xKB,大于等于 1MB 显示x.xxMBgetExtension(filePath)— 获取文件扩展名,返回小写的扩展名(含点号,如.js)
@common/fs(增强)
新增以下工具函数和类型:
scanDirectory(dirPath, options?)— 递归扫描目录,收集所有文件信息,支持按扩展名(includeExtensions)、路径模式(excludePatterns)和自定义过滤函数(filter)进行过滤writeJsonReport(filePath, data, indent?)— 将数据对象序列化为 JSON 格式并写入文件,默认缩进 2 个空格ScannedFile类型 — 扫描文件信息接口,包含filePath、size、extension字段ScanDirectoryOptions类型 — 目录扫描选项接口,包含includeExtensions、excludePatterns、filter字段
子路径导出(增强)
@meng-xi/vite-plugin/plugins新增导出类型:BundleAnalyzerOptions、BundleAnalysisResult、BundleOutputFormat、ChunkStats、ModuleStats、FileTypeDistribution、SizeWarning、ComparisonDiff@meng-xi/vite-plugin/plugins新增导出函数:bundleAnalyzer@meng-xi/vite-plugin/common/compress新增子路径导出,包含calculateGzipSize@meng-xi/vite-plugin/common/path新增子路径导出,包含isNodeModule@meng-xi/vite-plugin/common新增导出函数:calculateGzipSize、isNodeModule、escapeHtmlAttr、formatFileSize、getExtension、scanDirectory、writeJsonReport@meng-xi/vite-plugin/common新增导出类型:ScannedFile、ScanDirectoryOptions
平台兼容性
uni-app(3.7.9)
| Vue2 | Vue3 | Chrome | Safari | app-vue | app-nvue | Android | iOS | 鸿蒙 |
|---|---|---|---|---|---|---|---|---|
| √ | √ | √ | √ | √ | √ | √ | √ | √ |
| 微信小程序 | 支付宝小程序 | 抖音小程序 | 百度小程序 | 快手小程序 | 京东小程序 | 鸿蒙元服务 | QQ小程序 | 飞书小程序 | 小红书小程序 | 快应用-华为 | 快应用-联盟 |
|---|---|---|---|---|---|---|---|---|---|---|---|
| √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ | √ |
uni-app x(3.7.9)
| Chrome | Safari | Android | iOS | 鸿蒙 | 微信小程序 |
|---|---|---|---|---|---|
| √ | √ | √ | √ | √ | √ |
其他
| 多语言 | 暗黑模式 | 宽屏模式 |
|---|---|---|
| √ | √ | √ |
@meng-xi/vite-plugin
Vite 实用插件集与插件开发框架(uni-app 版本)。
特性
- 开箱即用 - 12 个实用插件,覆盖构建进度、产物分析与压缩、文件复制、环境变量校验、路由生成、版本管理、HTML 注入、图标管理、全局 Loading、自动导入等场景
- 插件开发框架 - 导出 BasePlugin、Logger、Validator 等核心组件,快速构建自定义 Vite 插件
- 通用工具库 - 内置 Common 工具模块,支持按需子路径导入
- 类型安全 - 完整 TypeScript 类型定义与配置验证器
- uni-app 适配 - 通过 uni_modules 方式集成,无需 npm 安装
📖 完整文档:https://mengxi-studio.github.io/vite-plugin/
安装
uni_modules(推荐)
将 vite-plugin 目录复制到项目的 uni_modules 目录下:
src/
└── uni_modules/
└── vite-plugin/
└── js_sdk/
└── index.mjs
npm
pnpm add @meng-xi/vite-plugin -D
npm 方式需将导入路径改为
@meng-xi/vite-plugin。
快速开始
import { defineConfig } from 'vite'
import uni from '@dcloudio/vite-plugin-uni'
import {
buildProgress,
bundleAnalyzer,
compressAssets,
copyFile,
envGuard,
generateRouter,
generateVersion,
htmlInject,
faviconManager,
loadingManager,
versionUpdateChecker,
autoImport
} from './uni_modules/vite-plugin/js_sdk/index.mjs'
export default defineConfig({
plugins: [
uni(),
autoImport({
imports: { vue: ['ref', 'reactive', 'computed'] },
dts: 'auto-imports.d.ts',
vueTemplate: true
}),
buildProgress(),
bundleAnalyzer({ outputFormat: 'json' }),
compressAssets({ algorithm: 'both' }),
copyFile({ sourceDir: 'src/assets', targetDir: 'dist/assets' }),
envGuard({ required: { VITE_API_URL: { type: 'url', required: true } } }),
generateRouter(),
generateVersion({ format: 'datetime', outputType: 'both' }),
htmlInject({ rules: [{ id: 'meta', content: '<meta name="description" content="My App">', position: 'head-end' }] }),
faviconManager('/assets'),
loadingManager({ defaultVisible: true, autoHideOn: 'DOMContentLoaded' }),
versionUpdateChecker()
]
})
内置插件
| 插件 | 说明 |
|---|---|
| autoImport | 自动导入,支持预设映射、目录扫描、Vue 模板自动导入和类型声明生成 |
| buildProgress | 终端实时构建进度条,支持 bar / spinner / minimal |
| bundleAnalyzer | 构建产物体积分析,支持 JSON/HTML 报告、gzip 计算、阈值告警和构建对比 |
| compressAssets | 构建产物压缩,支持 gzip / brotli / both,并发压缩和统计报告 |
| copyFile | 构建完成后复制文件或目录,支持增量复制 |
| envGuard | 环境变量校验,支持类型检查、范围验证、自定义规则和运行时守卫 |
| faviconManager | 管理网站图标链接注入和文件复制,支持字符串简写配置 |
| generateRouter | 根据 pages.json 自动生成路由配置(uni-app) |
| generateVersion | 自动生成版本号,支持文件输出和全局变量注入 |
| htmlInject | HTML 内容注入,支持多种位置、选择器定位、条件注入、模板变量和安全过滤 |
| loadingManager | 全局 Loading 状态管理,支持请求拦截、防抖、过渡动画和白屏 Loading |
| versionUpdateChecker | 运行时版本更新检查,支持多种提示样式和自定义回调 |
插件开发框架
本包导出完整的插件开发框架,帮助快速构建符合规范的自定义 Vite 插件。
import { BasePlugin, createPluginFactory } from './uni_modules/vite-plugin/js_sdk/index.mjs'
import type { Plugin } from 'vite'
interface MyPluginOptions {
prefix?: string
}
class MyPlugin extends BasePlugin<MyPluginOptions> {
protected getPluginName() {
return 'my-plugin'
}
protected getDefaultOptions() {
return { prefix: '[app]' }
}
protected validateOptions() {
this.validator.field('prefix').string().notEmpty().validate()
}
protected addPluginHooks(plugin: Plugin) {
plugin.writeBundle = {
order: 'post',
handler: async () => {
await this.safeExecute(async () => {
this.logger.info('插件执行中...')
}, '执行自定义逻辑')
}
}
}
}
export const myPlugin = createPluginFactory(MyPlugin)
核心 API:
| API | 说明 |
|---|---|
BasePlugin |
插件基类,提供配置管理、日志、错误处理和生命周期 |
createPluginFactory |
将 BasePlugin 子类转换为 Vite 插件函数 |
Logger |
全局单例日志管理器,为每个插件提供独立日志代理 |
Validator |
链式配置验证器,校验插件配置参数 |
Common 工具模块
内置通用工具函数库,按功能模块组织,支持子路径按需导入。
import { formatFileSize } from './uni_modules/vite-plugin/js_sdk/common/format/index.mjs'
import { scanDirectory } from './uni_modules/vite-plugin/js_sdk/common/fs/index.mjs'
import { injectBeforeTag } from './uni_modules/vite-plugin/js_sdk/common/html/index.mjs'
| 子路径 | 描述 |
|---|---|
common/format |
格式化工具 |
common/fs |
文件系统工具 |
common/html |
HTML 注入工具 |
common/script |
脚本生成工具 |
common/ui |
终端 UI 工具 |
common/validation |
参数验证工具 |
子路径导出
| 子路径 | 描述 |
|---|---|
./uni_modules/vite-plugin/js_sdk/index.mjs |
主入口(所有插件+框架) |
./uni_modules/vite-plugin/js_sdk/factory/index.mjs |
插件开发框架 |
./uni_modules/vite-plugin/js_sdk/logger/index.mjs |
日志管理器 |
./uni_modules/vite-plugin/js_sdk/plugins/index.mjs |
所有插件 |
./uni_modules/vite-plugin/js_sdk/common/index.mjs |
所有工具函数 |
./uni_modules/vite-plugin/js_sdk/common/*/index.mjs |
各工具子模块 |
./uni_modules/vite-plugin/js_sdk/plugins/auto-import/index.mjs |
autoImport 插件 |
./uni_modules/vite-plugin/js_sdk/plugins/build-progress/index.mjs |
buildProgress 插件 |
./uni_modules/vite-plugin/js_sdk/plugins/bundle-analyzer/index.mjs |
bundleAnalyzer 插件 |
./uni_modules/vite-plugin/js_sdk/plugins/compress-assets/index.mjs |
compressAssets 插件 |
./uni_modules/vite-plugin/js_sdk/plugins/copy-file/index.mjs |
copyFile 插件 |
./uni_modules/vite-plugin/js_sdk/plugins/env-guard/index.mjs |
envGuard 插件 |
./uni_modules/vite-plugin/js_sdk/plugins/favicon-manager/index.mjs |
faviconManager 插件 |
./uni_modules/vite-plugin/js_sdk/plugins/generate-router/index.mjs |
generateRouter 插件 |
./uni_modules/vite-plugin/js_sdk/plugins/generate-version/index.mjs |
generateVersion 插件 |
./uni_modules/vite-plugin/js_sdk/plugins/html-inject/index.mjs |
htmlInject 插件 |
./uni_modules/vite-plugin/js_sdk/plugins/loading-manager/index.mjs |
loadingManager 插件 |
./uni_modules/vite-plugin/js_sdk/plugins/version-update-checker/index.mjs |
versionUpdateChecker 插件 |

收藏人数:
https://github.com/MengXi-Studio/vite-plugin
https://www.npmjs.com/package/@meng-xi/vite-plugin
下载插件并导入HBuilderX
下载插件ZIP
赞赏(0)
下载 41
赞赏 0
下载 12175276
赞赏 1918
赞赏
京公网安备:11010802035340号