Commit 493b4a47 authored by 徐光星's avatar 徐光星

feat: 调整sentry配置

parent b5911006
...@@ -8,18 +8,18 @@ import '@/service/cherryUI.service'; ...@@ -8,18 +8,18 @@ import '@/service/cherryUI.service';
import './style/index.less'; import './style/index.less';
import saService from '@/service/sa.service'; import saService from '@/service/sa.service';
import Bridge from '@qg/js-bridge'; import Bridge from '@qg/js-bridge';
import { init as sentryInit } from '@sentry/vue'; // import { init as sentryInit } from '@sentry/vue';
import lazyload from '@qg/cherry-ui/src/lazyload/index'; import lazyload from '@qg/cherry-ui/src/lazyload/index';
import 'intersection-observer'; import 'intersection-observer';
if (process.env.SENTRY_ENV === 'prod' && process.env.NODE_ENV === 'production') { // if (process.env.SENTRY_ENV === 'prod' && process.env.NODE_ENV === 'production') {
sentryInit({ // sentryInit({
Vue, // Vue,
dsn: 'https://d36508238b7c4e5fa8306948b52948e1@sentry.q-gp.com/11', // 项目设置中的Client Keys // dsn: 'https://d36508238b7c4e5fa8306948b52948e1@sentry.q-gp.com/11', // 项目设置中的Client Keys
release: `group-buy-ui@${process.env.GIT_VERSION || '1.0.0'}`, // 项目名加版本号 // release: `group-buy-ui@${process.env.GIT_VERSION || '1.0.0'}`, // 项目名加版本号
tracesSampleRate: 0.5, // 上报频率, 1最大, 0最小, 建议验证设置为1, 项目运行根据情况降低频率 // tracesSampleRate: 0.5, // 上报频率, 1最大, 0最小, 建议验证设置为1, 项目运行根据情况降低频率
environment: process.env.NODE_ENV // environment: process.env.NODE_ENV
}); // });
} // }
Vue.prototype.util = new Bridge(); Vue.prototype.util = new Bridge();
Vue.prototype.$track = saService; Vue.prototype.$track = saService;
saService.init(router); saService.init(router);
......
...@@ -3,8 +3,8 @@ const resolve = dir => path.join(__dirname, dir); ...@@ -3,8 +3,8 @@ const resolve = dir => path.join(__dirname, dir);
const IS_PROD = process.env.NODE_ENV === 'production'; const IS_PROD = process.env.NODE_ENV === 'production';
const webpack = require('webpack'); const webpack = require('webpack');
const WebpackCosCdnUploadPlugin = require('@qg/webpack-cos-cdn-upload-plugin'); const WebpackCosCdnUploadPlugin = require('@qg/webpack-cos-cdn-upload-plugin');
const SentryPlugin = require('@qg/sentry-webpack-plugin'); // const SentryPlugin = require('@qg/sentry-webpack-plugin');
const SentryConfig = require('./.sentryclirc'); // const SentryConfig = require('./.sentryclirc');
// cdn预加载使用 // cdn预加载使用
const externals = { const externals = {
vue: 'Vue', vue: 'Vue',
...@@ -139,7 +139,7 @@ module.exports = { ...@@ -139,7 +139,7 @@ module.exports = {
config.externals = externals; config.externals = externals;
configObj = { configObj = {
plugins: [ plugins: [
new SentryPlugin(SentryConfig), // new SentryPlugin(SentryConfig),
new webpack.DefinePlugin({ new webpack.DefinePlugin({
'process.env.SENTRY_ENV': `"${process.env.SENTRY_ENV || ''}"`, 'process.env.SENTRY_ENV': `"${process.env.SENTRY_ENV || ''}"`,
'process.env.GIT_VERSION': `"${process.env.GIT_VERSION || ''}"` 'process.env.GIT_VERSION': `"${process.env.GIT_VERSION || ''}"`
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment