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

@heathenjs/taro-router-plugin

v1.1.5

Published

在Taro构建时自动生成路由方法及页面路由配置

Readme

@heathenjs/taro-router-plugin

在Taro构建时自动生成 @heathenjs/taro-router 所需的路由,并自动配置路由信息到app.config

特性

使用

Step 1

安装

pnpm

pnpm add @heathenjs/taro-router-plugin --save-dev
pnpm add @heathenjs/taro-router

yarn

yarn add @heathenjs/taro-router-plugin --dev
yarn add @heathenjs/taro-router

npm

npm install @heathenjs/taro-router-plugin --save-dev
npm install @heathenjs/taro-router --save

Step 2

在项目根目录创建配置文件 router.config.json ,参考配置信息如下:

{
  "ignore": [
    "components",
  ],
  "defaultPage": "pages/default/index/index",
  "packages": [
    {
      "name": "package1",
      "pagePath": "./src/pages/package1"
    },
    {
      "name": "package2",
      "pagePath": "./src/pages/package2"
    },
    {
      "name": "default",
      "pagePath": "./src/pages/default",
      "isMainPackage": true
    }
  ]
}

详见配置参数说明

Step 3

taro构建配置中增加插件

export default {
    plugins: [
      '@heathenjs/taro-router-plugin',
    ],
}

完成!此时你不需要在 app.config 中再编写任何路由/页面相关的配置,插件会自动生成。

配置参数说明

ignore

不参与路由构建的目录,例如在页面中临时使用的一些组件。配置语法参考ignore

默认情况下,会将 pagePath 目录下所有 index.js/index.jsx/index.jsx/index.tsx 识别为页面文件

defaultPage

进入小程序时的初始页面。必须是主包的页面。

packages

分包配置

name

分包名

pagePath

包页面路径

isMainPackage

是否为主包。必须有且仅有一个 package 的 isMainPackage 为true