Commit 17ff2add authored by 徐光星's avatar 徐光星

Merge branch 'feat/cmdb' into 'master'

feat: 调整sentry配置

See merge request !18
parents dfa9fa25 493b4a47
const crypto = require('crypto');
const pkgInfo = require('./package.json');
const project = pkgInfo.name;
const VERSION = process.env.GIT_VERSION || '1.0.0'
const hashName = crypto
.createHash('md5')
.update(project)
......@@ -12,7 +13,7 @@ module.exports = {
project,
authToken: '3f1f6f3789594e3a81280c1cd8d4d1008037a7abad714698b60b6f358c3d7562',
url: 'http://newsentry.quantgroups.com',
release: `${project}@1.0.0`,
release: `${project}@${VERSION}`,
ignore: ['node_modules', 'tests'],
silent: true,
include: [
......
......@@ -8,18 +8,18 @@ import '@/service/cherryUI.service';
import './style/index.less';
import saService from '@/service/sa.service';
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 'intersection-observer';
if (process.env.SENTRY_ENV !== 'test' && process.env.NODE_ENV === 'production') {
sentryInit({
Vue,
dsn: 'https://d36508238b7c4e5fa8306948b52948e1@sentry.q-gp.com/11', // 项目设置中的Client Keys
release: 'group-buy-ui@1.0.0', // 项目名加版本号
tracesSampleRate: 0.5, // 上报频率, 1最大, 0最小, 建议验证设置为1, 项目运行根据情况降低频率
environment: process.env.NODE_ENV
});
}
// if (process.env.SENTRY_ENV === 'prod' && process.env.NODE_ENV === 'production') {
// sentryInit({
// Vue,
// dsn: 'https://d36508238b7c4e5fa8306948b52948e1@sentry.q-gp.com/11', // 项目设置中的Client Keys
// release: `group-buy-ui@${process.env.GIT_VERSION || '1.0.0'}`, // 项目名加版本号
// tracesSampleRate: 0.5, // 上报频率, 1最大, 0最小, 建议验证设置为1, 项目运行根据情况降低频率
// environment: process.env.NODE_ENV
// });
// }
Vue.prototype.util = new Bridge();
Vue.prototype.$track = saService;
saService.init(router);
......
......@@ -3,8 +3,8 @@ const resolve = dir => path.join(__dirname, dir);
const IS_PROD = process.env.NODE_ENV === 'production';
const webpack = require('webpack');
const WebpackCosCdnUploadPlugin = require('@qg/webpack-cos-cdn-upload-plugin');
const SentryPlugin = require('@qg/sentry-webpack-plugin');
const SentryConfig = require('./.sentryclirc');
// const SentryPlugin = require('@qg/sentry-webpack-plugin');
// const SentryConfig = require('./.sentryclirc');
// cdn预加载使用
const externals = {
vue: 'Vue',
......@@ -139,9 +139,10 @@ module.exports = {
config.externals = externals;
configObj = {
plugins: [
new SentryPlugin(SentryConfig),
// new SentryPlugin(SentryConfig),
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 || ''}"`
}),
new WebpackCosCdnUploadPlugin()
]
......
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