Commit 86be0fcf authored by 郝聪敏's avatar 郝聪敏

feature: 添加sentry

parent d6f97bb3
import { Vue, Component, Prop } from 'vue-property-decorator'; import { Vue, Component, Prop } from 'vue-property-decorator';
// import cherryUi from '../../../../../node_modules/@qg/cherry-ui/src/index';
import cherryUi from '@qg/cherry-ui'; import cherryUi from '@qg/cherry-ui';
import Raven from 'raven-js';
import RavenVue from 'raven-js/plugins/vue';
import { release } from '@/.sentryclirc.js';
import '@qg/cherry-ui/dist/cherry.css'; import '@qg/cherry-ui/dist/cherry.css';
Vue.use(cherryUi); Vue.use(cherryUi);
// 初始化sentry
if (process.env.SENTRY_ENV !== 'test' && process.env.NODE_ENV === 'production') {
Raven.config('http://0785298052fd46128e201f30ca649102@sentry.q-gp.com/64', {
release,
environment: 'production'
})
.addPlugin(RavenVue, Vue)
.install();
}
@Component({ @Component({
name: 'Layout' name: 'Layout'
}) })
......
import { Vue, Component, Prop, Watch } from 'vue-property-decorator'; import { Vue, Component, Prop, Watch } from 'vue-property-decorator';
import iView from 'iview'; import iView from 'iview';
import cherryUi from '@qg/cherry-ui'; import cherryUi from '@qg/cherry-ui';
import Raven from 'raven-js';
import RavenVue from 'raven-js/plugins/vue';
import { release } from '@/.sentryclirc.js';
import VueContextMenu from '@editor/component/Contextmenu/index'; import VueContextMenu from '@editor/component/Contextmenu/index';
import localStorage from '@/service/localStorage.service'; import localStorage from '@/service/localStorage.service';
import 'iview/dist/styles/iview.css'; import 'iview/dist/styles/iview.css';
...@@ -10,6 +13,16 @@ Vue.use(iView); ...@@ -10,6 +13,16 @@ Vue.use(iView);
Vue.use(cherryUi); Vue.use(cherryUi);
Vue.use(VueContextMenu); Vue.use(VueContextMenu);
// 初始化sentry
if (process.env.SENTRY_ENV !== 'test' && process.env.NODE_ENV === 'production') {
Raven.config('http://0785298052fd46128e201f30ca649102@sentry.q-gp.com/64', {
release,
environment: 'production'
})
.addPlugin(RavenVue, Vue)
.install();
}
@Component({ @Component({
name: 'Layout', name: 'Layout',
}) })
......
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
"npm": "^6.14.10", "npm": "^6.14.10",
"postcss-px2rem": "^0.3.0", "postcss-px2rem": "^0.3.0",
"qs": "^6.9.4", "qs": "^6.9.4",
"raven-js": "^3.27.2",
"sa-sdk-javascript": "^1.15.27", "sa-sdk-javascript": "^1.15.27",
"sequelize": "^4.38.0", "sequelize": "^4.38.0",
"sequelize-typescript": "^0.6.6", "sequelize-typescript": "^0.6.6",
...@@ -80,7 +81,8 @@ ...@@ -80,7 +81,8 @@
"tslint": "^5.9.1", "tslint": "^5.9.1",
"tslint-eslint-rules": "^5.4.0", "tslint-eslint-rules": "^5.4.0",
"tslint-loader": "^3.5.3", "tslint-loader": "^3.5.3",
"typescript": "^3.9.2" "typescript": "^3.9.2",
"webpack-sentry-plugin": "^1.16.0"
}, },
"egg": { "egg": {
"typescript": true "typescript": true
......
'use strict'; 'use strict';
const path = require('path'); const path = require('path');
const SentryPlugin = require("webpack-sentry-plugin");
const resolve = filepath => path.resolve(__dirname, filepath); const resolve = filepath => path.resolve(__dirname, filepath);
const SentryConfig = require("./app/web/.sentryclirc.js");
module.exports = { module.exports = {
entry: { entry: {
'login': 'app/web/page/login/index.vue', 'login': 'app/web/page/login/index.vue',
...@@ -56,7 +59,14 @@ module.exports = { ...@@ -56,7 +59,14 @@ module.exports = {
to: 'asset' to: 'asset'
}] }]
}, },
{ imagemini: false } { imagemini: false },
// {
// sentry: {
// name: 'webpack-sentry-plugin',
// args: SentryConfig
// }
// }
// new SentryPlugin(SentryConfig)
], ],
devtool:'source-map', devtool:'source-map',
customize(webpackConfig){ customize(webpackConfig){
......
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