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

uni-devtool

v1.0.5

Published

uni-app调试工具

Readme

小程序调试工具

基于uni-app

图片

支持功能

  • network查看
  • 扫码打开h5页面
  • 查看页面基本信息
  • 全局注入自定义组件

更新日志

使用方式

1.安装依赖

npm i uni-devtool --save-dev

2.修改vue.config.js

注意区分环境,只在非正式环境注入

module.exports = {
  chainWebpack: (config) => {
    config.module
      .rule('uni-devtool') // 链式操作用来分组的名字
      .test(/\.(vue)|(js)|(json)$/)
      .pre()
      .exclude.add(/node_modules/)
      .end()
      .use('uni-devtool')
      .loader('uni-devtool')
      .options({
        devtool: true, // 是否开启调试工具,可根据项目实际情况,控制在不同环境下是否开启
      })
  },
}

选项

components

要在每个页面注入的自定义组件

{
  components: [{
      path: 'my-button/components/index.vue', // 组件路径,node_modules里的组件,或相对main.js的相对路径,如./components/my-button/index.vue
      name: 'MyButton' // 组件名,驼峰形式
    }]
}

devtool

是否注入调试工具,根据各小程序具体情况判断,只在非线上环境注入。

pagesJsonPath

pages.json文件的绝对路径,以该文件里的配置判断是否为页面级vue,给其注入组件调用。默认为src/pages.json

injectComponentRule

pages.json不满足需求时,可以配置injectComponentRule,接收正则数组。

工作原理

在入口(默认为src/main.js)文件中引入要注入的组件并注册为全局组件,并进行一些初始化(重写wx.request等),根据项目pages.json,在编译时对每个页面文件中的template中插入组件的调用。

main.js

// 插入
import MyButton from 'my/button/index.vue' // 组件名和路径对应上面配置的name和path,所以是相对main.js的路径
Vue.component('my-button', MyButton)

页面文件

源文件

<template>
  <div>
    hello
  </div>
</template>
<script>
 // ...
</script>

编译时经loader处理后

<template>
  <div><wy-mp-devtool></wy-mp-devtool>
    hello
  </div>
</template>
<script>
 // ...
</script>