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 🙏

© 2026 – Pkg Stats / Ryan Hefner

vite-plugin-uni-wx-project

v0.1.2

Published

Generate a plug-in based on the project.private.config.json file of the WeChat mini-program of the uni-app project

Readme

Vite-plugin-uni-wx-project

基于 uni-app 项目文件系统的微信小程序project.private.config.json文件生成插件。

安装

pnpm install -D vite-plugin-uni-wx-project

使用

注意:此插件只在 vite 启动时执行一次,所以如果有更新需重启vite。

import { defineConfig } from 'vite'
import UniWxProject from 'vite-plugin-uni-wx-project'

export default defineConfig(() => {
  return {
    plugins: [
      UniWxProject({ dir: './src' })
    ]
  }
})
// src/pages/login/index.vue
<project-private>
{
  name: '登录',
}
</project-private>

<template>
<view class="login_wx">
  微信登录
</view>
</template>

插件会分析项目中所有.vue文件中的<project-private></project-private>标签数据,然后更新微信小程序开发工具需要的./src/project.private.config.json文件。

{
  "condition": {
    "miniprogram": {
      "list": [
        { "name": "登录",
          "pathName": "pages/login/index",
          "query": "",
          "launchMode": "default",
          "scene": null
        }
      ]
    }
  }
}

UniWxProject 方法的入参

  • dir: project.private.config.json文件所在目录。构建后只更新文件中condition.miniprogram.list的内容。
  • lang: project-private 中数据类型,'json5' | 'json' | 'yaml' | 'yml'

project-private 格式

project-private标签内字段:

interface ProjectMini {
  name?: string
  /** 页面路径 */
  pathName: string
  /** 页面启动时的参数 示例:id=123 */
  query?: string,
  /** 页面启动模式 */
  launchMode?: 'default',
  /** 场景值,用于指定小程序的启动场景。 示例:1001 表示通过小程序列表进入 */
  scene?: null
}

支持单数据 ProjectMini

<project-private lang="json5">
{
  name: '登录-微信登录',
}
</project-private>

也支持同时设置多个 ProjectMini[] 数据

<project-private>
[
  {
    name: '登录后回跳首页',
    query: 'form_url=/pages/index',
  },
  {
    name: '登录后回跳设置页',
    query: 'form_url=/pages/settingkkk',
  }
]
</project-private>