1.3.1 • Published 2 years ago

vite-plugin-perform v1.3.1

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

加载耗时上报插件

  • 安装
npm install vite-plugin-perform
  • 使用
  1. 在vite中注册插件
import vitePluginPerform from './vite-plugin-perform'; 
export default defineConfig({
  plugins: [vitePluginPerform()], 
}) 
  1. 在项目入口文件中引入

    reportSend 是被注册到window上的事件,可以被全局访问到,参数1作为需要传递的数据,参数2作为上报的url,你可以通过设置环境变量来控制在生产环境下和开发环境下不同的相应

import 'virtual:perform';
// 不传url就是本地打印,传递 的数据需要进行JSON.stringify
reportSend(JSON.stringify({name:'1x'}));
1.3.1

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.2.0

2 years ago

1.0.0

2 years ago