npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@touchvue/plugin

v1.0.0-beta.3

Published

Vue3 Plugin Library

Readme

Plugin 构建方案

概述

@touchvue/plugin 使用 Vite 进行独立构建,生成 ES 模块和 CommonJS 两种格式,并自动生成 TypeScript 类型声明文件。

构建配置

Vite 配置文件

配置文件位于 packages/plugin/vite.config.ts,包含以下特性:

  • Vue 组件编译: 使用 @vitejs/plugin-vue 编译 Vue SFC 文件
  • 类型声明生成: 使用 vite-plugin-dts 自动生成 .d.ts 文件
  • 样式处理: 支持 LESS、SCSS 预处理器
  • 路径别名: 配置 @ 指向 src 目录,@touchvue/utils@touchvue/hooks 指向对应工作区包
  • 外部依赖: 将 vueechartsecharts-gltinymce 等标记为外部依赖

构建输出

构建完成后,输出目录结构如下:

dist/
├── index.js          # ES 模块入口
├── index.cjs         # CommonJS 入口
├── index.d.ts        # 类型声明文件
├── components/       # 组件输出
│   ├── echarts-bar/
│   ├── echarts-map/
│   ├── echarts-pie/
│   ├── editor/
│   ├── step-tree/
│   └── watermark/
└── style/            # 样式文件

构建命令

基础构建

# 在 plugin 目录下
pnpm build

# 或者在根目录下
pnpm build:plugin

生产环境构建

pnpm build:prod

类型检查

pnpm type-check

使用方式

完整引入

import { createApp } from 'vue'
import TouchVuePlugin from '@touchvue/plugin'

const app = createApp()
app.use(TouchVuePlugin)

按需引入组件

import { ToEditor, ToWatermark } from '@touchvue/plugin'

技术栈

  • 构建工具: Vite 4.x
  • Vue 版本: Vue 3.3+
  • TypeScript: 5.x
  • 样式预处理: LESS、SCSS
  • 类型声明: vite-plugin-dts

注意事项

  1. 外部依赖: vueechartsecharts-gltinymce 作为 peerDependencies,需要在使用方项目中安装
  2. 样式处理: Vue SFC 中的 <style> 标签会被自动提取并处理
  3. 类型声明: 构建时会自动生成类型声明文件,无需手动维护
  4. 工作区依赖: @touchvue/utils@touchvue/hooks 通过 workspace 协议引用