Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sentry webpack plugin for source maps #546

Merged
merged 3 commits into from
Aug 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,6 @@ node_modules
jspm_packages

# Serverless directories
.serverless
.serverless
# Sentry Auth Token
.env.sentry-build-plugin
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"@nivo/sunburst": "^0.82.1",
"@nivo/treemap": "^0.82.1",
"@sentry/react": "^7.57.0",
"@sentry/webpack-plugin": "^2.5.0",
"babel-runtime": "^6.26.0",
"chroma-js": "^2.4.2",
"classnames": "^2.3.1",
Expand Down
2 changes: 1 addition & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Sentry.init({
integrations: [
new Sentry.BrowserTracing({
// Set `tracePropagationTargets` to control for which URLs distributed tracing should be enabled
tracePropagationTargets: ['localhost', /^https:\/\/neodash\.graphapp\.io/, /^http:\/\/neodash\.graphapp\.io/],
tracePropagationTargets: [/^https:\/\/neodash\.graphapp\.io/, /^http:\/\/neodash\.graphapp\.io/],
}),
new Sentry.Replay(),
],
Expand Down
11 changes: 10 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin');
const { sentryWebpackPlugin } = require('@sentry/webpack-plugin');
const rules = [
{
test: /\.(js|jsx|ts|tsx)$/,
Expand Down Expand Up @@ -51,7 +52,15 @@ module.exports = (env) => {
port: 3000,
hot: true,
},
plugins: production ? [] : [new ReactRefreshWebpackPlugin()],
plugins: production
? [
sentryWebpackPlugin({
authToken: process.env.SENTRY_AUTH_TOKEN,
org: 'neo4j-inc',
project: 'neodash',
}),
]
: [new ReactRefreshWebpackPlugin()],
ignoreWarnings: [/Failed to parse source map/],
};
};
Loading