New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@uni-helper/plugin-uni

Package Overview
Dependencies
Maintainers
3
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@uni-helper/plugin-uni

uni-app plugin 的 ESM 导出

latest
Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
777
43.62%
Maintainers
3
Weekly downloads
 
Created
Source

@uni-helper/plugin-uni

为 uni-app 提供的 原生 ESM Vite 插件,让你在 ESM-First 环境中零成本接入 uni-app 构建体系。

[!TIP]

  • 零运行时影响

    本包仅为 ESM 重导出,无额外逻辑,因此不会增加构建耗时或引入潜在缺陷。

  • 问题归属

    如遇构建异常,请先确认是否由官方插件引起,并向 dcloudio/uni-app 提交 issue;

    若可定位为转发层缺陷,请附最小复现仓库至 @uni-helper/plugin-uni

  • 维护计划

    将持续跟进官方 ESM 支持进度;一旦官方提供原生 ESM 版本,本项目将归档并停止维护。

✨ 亮点

特性说明
🚀 原生 ESM完全遵循 import/export 规范,无需 .default() 适配
🛡️ 完整类型TypeScript 类型与 @dcloudio/vite-plugin-uni 同步,IDE 提示零丢失
🪶 零依赖转发通过 peerDependencies 复用用户项目中的官方插件,不锁版本
🧩 即装即用一行 import,即可替换官方 CJS 插件

📦 安装

npm i -D @uni-helper/plugin-uni

[!IMPORTANT] 请确保已安装官方插件 @dcloudio/vite-plugin-uni,否则本插件将无法正常工作。

🔧 使用

{
  "type": "module",
  "devDependencies": {
    "@dcloudio/vite-plugin-uni": "xxx",
    "@uni-helper/plugin-uni": "^0.1.0"
  }
}
import Uni from '@uni-helper/plugin-uni'
// vite.config.ts
import { defineConfig } from 'vite'

export default defineConfig({
  plugins: [
    Uni({ /* 同官方配置 */ })
  ]
})

⚙️ 工作原理

  • 本包仅做 ESM 重导出CJS→ESM 兼容性语法糖,不携带任何运行时逻辑。
  • 通过 peerDependencies 复用用户项目中的 @dcloudio/vite-plugin-uni,确保版本由用户掌控。
  • 手动导出d.ts文件,确保类型与官方插件一致。

🙇🏻‍♂️ 赞助

sponsors

Keywords

uni-app

FAQs

Package last updated on 25 Jul 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts