diff --git a/package.json b/package.json index 6099c60e8be1b5cbb6555d63fdd26c1e79336f81..2632343ed6d5eda5e4ee78e1110ba2bb96013653 100755 --- a/package.json +++ b/package.json @@ -67,6 +67,7 @@ "lint-staged": "^4.3.0", "mockjs": "^1.0.1-beta3", "pro-download": "^1.0.0", + "raven-js": "^3.20.1", "react-test-renderer": "^16.0.0", "redbox-react": "^1.3.2", "roadhog": "^1.3.1", diff --git a/src/index.js b/src/index.js index d2dd78cd6196a4351756a8cfc57512b12463af83..fd0de02be3402c2ffa00f3ce1c81220c7b7f34db 100644 --- a/src/index.js +++ b/src/index.js @@ -2,6 +2,7 @@ import dva from 'dva'; import 'moment/locale/zh-cn'; import './polyfill'; import './g2'; +import './raven'; // import { browserHistory } from 'dva/router'; import './index.less'; diff --git a/src/raven.js b/src/raven.js new file mode 100644 index 0000000000000000000000000000000000000000..2f51aab7b4234c5c5635241486ab92a0059656c1 --- /dev/null +++ b/src/raven.js @@ -0,0 +1,6 @@ +import Raven from 'raven-js'; + +// Track error by https://sentry.io/ +if (location.host === 'preview.pro.ant.design') { + Raven.config('https://969e74e863854cf0ae7d7d72f534bd3e@sentry.io/247221').install(); +}