Skip to content

Commit 3914eaa

Browse files
authored
Merge pull request #546 from neo4j-labs/housekeeping/sentry-source-maps
Add sentry webpack plugin for source maps
2 parents df0a42d + 87bfb3b commit 3914eaa

File tree

5 files changed

+208
-26
lines changed

5 files changed

+208
-26
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,6 @@ node_modules
3737
jspm_packages
3838

3939
# Serverless directories
40-
.serverless
40+
.serverless
41+
# Sentry Auth Token
42+
.env.sentry-build-plugin

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
"@nivo/sunburst": "^0.82.1",
5858
"@nivo/treemap": "^0.82.1",
5959
"@sentry/react": "^7.57.0",
60+
"@sentry/webpack-plugin": "^2.5.0",
6061
"babel-runtime": "^6.26.0",
6162
"chroma-js": "^2.4.2",
6263
"classnames": "^2.3.1",

src/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Sentry.init({
1616
integrations: [
1717
new Sentry.BrowserTracing({
1818
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
19-
tracePropagationTargets: ['localhost', /^https:\/\/neodash\.graphapp\.io/, /^http:\/\/neodash\.graphapp\.io/],
19+
tracePropagationTargets: [/^https:\/\/neodash\.graphapp\.io/, /^http:\/\/neodash\.graphapp\.io/],
2020
}),
2121
new Sentry.Replay(),
2222
],

webpack.config.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin');
2+
const { sentryWebpackPlugin } = require('@sentry/webpack-plugin');
23
const rules = [
34
{
45
test: /\.(js|jsx|ts|tsx)$/,
@@ -51,7 +52,15 @@ module.exports = (env) => {
5152
port: 3000,
5253
hot: true,
5354
},
54-
plugins: production ? [] : [new ReactRefreshWebpackPlugin()],
55+
plugins: production
56+
? [
57+
sentryWebpackPlugin({
58+
authToken: process.env.SENTRY_AUTH_TOKEN,
59+
org: 'neo4j-inc',
60+
project: 'neodash',
61+
}),
62+
]
63+
: [new ReactRefreshWebpackPlugin()],
5564
ignoreWarnings: [/Failed to parse source map/],
5665
};
5766
};

0 commit comments

Comments
 (0)