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 🙏

© 2024 – Pkg Stats / Ryan Hefner

vitejs-plugin-zzd-buried-point

v0.0.26

Published

浙政钉埋点插件

Downloads

24

Readme

vitejs-plugin-zzd-buried-point

vite 浙政钉埋点插件

安装

npm i vitejs-plugin-zzd-buried-point --save-dev

使用指南

vite 插件注入

1、vite.config.ts

import {defineConfig} from "vite"
import ZzdBuriedPoint from 'vitejs-plugin-zzd-buried-point'

export default defineConfig({
    plugins:[
        ZzdBuriedPoint({
            zzdTestCode:{
                appTitle: '测试应用名称',
                bid: '平台应用绑定id',
                signkey: '应用签名',
                sapp_id: '应用id',
                sapp_name: '用用名称',
            },
            // .....可以配置更多应用信息
        }),
    ]
})

基础信息埋点

2、vue-router

import ZzdBuriedPoint from 'vitejs-plugin-zzd-buried-point/ZzdBuriedPoint'
router.beforeEach(async(to, from, next) => {
    //todo <!--【开始】==========浙政钉埋点基础信息,禁止删除=======-->
    new ZzdBuriedPoint(zzdCode).createBaseBurialPoint({
        page_id: to.fullPath,
        page_name: to.name as any,
        page_url: to.path,
    })
    //todo <!--【结束】==========浙政钉埋点基础信息,禁止删除=======-->
})

基础信息埋点

3、项目登陆页面

import ZzdBuriedPoint from 'vitejs-plugin-zzd-buried-point/ZzdBuriedPoint'
//todo <!--【开始】==========浙政钉埋点用户信息,禁止删除=======-->
new ZzdBuriedPoint(zzdCode).createUserInfoBurialPoint({
    _user_nick:'用户名称',
    _user_id:'用户id',
})
//todo <!--【结束】==========浙政钉埋点用户信息,禁止删除=======-->

稳定性监控、通用采集

3、index.html添加以下注释

<!DOCTYPE html>
<html lang="zh-cn">
  <head>
    <meta charset="UTF-8" />
    <link rel="icon" href="/favicon.ico" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Vite App</title>
    <!--【开始】==========浙政钉埋点html信息,禁止删除=======-->
    <!--${zzdHtml}-->
    <!--【结束】==========浙政钉埋点html信息,禁止删除=======-->
  </head>
  <body>
    <div id="app"></div>
    <script type="module" src="/src/main.ts"></script>
  </body>
</html>

使用配置

请在对应的开发模式下的环境变量设置对应的浙政钉埋点code

例如:开发模式下,则在 .env.production 文件中加入以下代码, 建议在生产模式加即.env.production文件

# 浙政钉埋点code
VITE_ZZD_CODE=zzdTestCode

# 你的其他环境配置
# ....