1.1.0 • Published 3 years ago

umeng-points v1.1.0

Weekly downloads
-
License
ISC
Repository
gitlab
Last release
3 years ago

umeng-points 埋点npm工具

针对小程序场景封装的npm工具库,使用rollup打包构建

维护者

  • ZheGuang

steps

    git clone git@gitlab.acewill.cn:welife/weapps-plugin.git
    cd weapps-plugin
    cd umeng-points
    yarn install 
    npm run watch //自动监听改动,并直接 build
    // 发包前
    npm run build

命令

    "build:dev": "rollup -c --env=develop", //压缩
    "build": "rollup -c", //生产构建不进行压缩
    "watch": "rollup -c rollup.config.js --watch --env=develop", //监听构建 --env参数判断是否压缩构建
    "test": "jest"  //测试

案例

app.js

// 根据实际场景使用对应的方法与函数
import {  UmengConfig, MayBe, SuperPoints, UMengInit, SuperEventPoints } from "umeng-points"

目录

  • lib : 源码文件

    • index.js 主入口文件
    • umengconfig 埋点配置文件-也包含了pageview umengsdk 接入等
    • umengEvent 点击与复杂事件,继承自umengconfig
    • umengkeys 维护所有埋点key的文件,只能放入这里key
  • dist: 编译后文件-也是小程序构建npm后的导入地址

技术背景

【【标+OMP】小程序页面增加数据统计】 https://www.tapd.cn/62490594/prong/stories/view/1162490594001216940

调试

  • 小程序 安装本地路径,进行调试(npm run build:dev 或者 npm run watch )