Skip to content

Commit fe85212

Browse files
committed
Update app to support sentry and source map
* add sentry * add source map
1 parent 0669bae commit fe85212

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

app/config/sentry_config.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import Raven from 'raven-js';
2+
3+
const _APP_INFO = {
4+
name: 'Github Battle',
5+
branch: 'master',
6+
version: '1.0.0',
7+
};
8+
9+
const sentryKey = 'bca465026dc84ef6a92815c236f86d98';
10+
const sentryAppID = '94335';
11+
const sentryServerUrl = 'app.getsentry.com';
12+
13+
const createSentryConfig = (key, app, server = sentryServerUrl) =>
14+
Raven.config(`https://${key}@${server}/${app}`, {
15+
release: _APP_INFO.version,
16+
tags: {
17+
branch: _APP_INFO.branch,
18+
}
19+
});
20+
21+
export default createSentryConfig(sentryKey, sentryAppID);

app/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@
22
import ReactDOM from 'react-dom';
33

44
import routes from './config/routes';
5+
import sentryConfig from './config/sentry_config';
56

7+
// install sentry
8+
sentryConfig.install();
9+
10+
windows.fuck();
11+
12+
// render react router to #app
613
ReactDOM.render(
714
routes,
815
document.getElementById('app')

webpack.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ var HtmlWebpackPluginConfig = new HtmlWebpackPlugin({
77
});
88

99
module.exports = {
10+
devtool: 'source-map',
1011
entry: [
1112
'./app/index.js',
1213
],

0 commit comments

Comments
 (0)