错误监控工具-Sentry
1. 安装依赖
npm i @sentry/browser
npm i @sentry/integrationsnpm i @sentry/react2. 申请权限
https://<key>@report.url.cn/sentry/<project>3、项目接入sentry
// /src/index.js
import * as Sentry from '@sentry/browser';
import * as Integrations from '@sentry/integrations';
const RELEASE_VERSION = require('../package.json').version
Sentry.init({
dsn: "", // 步骤2所得到的地址
integrations: [
new Integrations.Vue({
Vue,
attachProps: true,
}),
new Integrations.RewriteFrames(),
],
release: RELEASE_VERSION, // 版本号
});4、上传sourcemap
4.1 安装依赖
4.2 配置.sentryclirc文件
4.3 配置webpack - vue2.0 + react
4.4 配置webpack - vue3.0
4.5 其他
最后更新于