Skip to content

Commit 29d37f3

Browse files
mydeaLuca Forstner
andauthored
build: Update to @sentry/webpack-plugin v2.0.0-alpha (#6911)
Co-authored-by: Luca Forstner <luca.forstner@sentry.io>
1 parent c8b5042 commit 29d37f3

File tree

3 files changed

+1023
-73
lines changed

3 files changed

+1023
-73
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"@mdx-js/react": "^1.6.18",
1919
"@sentry-internal/global-search": "^0.5.7",
2020
"@sentry/browser": "7.51.2",
21-
"@sentry/webpack-plugin": "^1.20.0",
21+
"@sentry/webpack-plugin": "2.0.0-alpha.6",
2222
"@types/dompurify": "^3.0.2",
2323
"@types/node": "^12",
2424
"@types/react-helmet": "^6.1.0",

src/gatsby/onCreateWebpackConfig.ts

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,9 @@
33

44
import path from 'path';
55

6-
import SentryWebpackPlugin from '@sentry/webpack-plugin';
6+
import {sentryWebpackPlugin} from '@sentry/webpack-plugin';
77

8-
const getPlugins = reporter => {
9-
const authToken = process.env.SENTRY_WEBPACK_PLUGIN_AUTH_TOKEN;
10-
if (!authToken) {
11-
reporter.warn('SENTRY_AUTH_TOKEN is not set - will not upload source maps');
12-
return [];
13-
}
14-
return [
15-
new SentryWebpackPlugin({
16-
org: 'sentry',
17-
project: 'docs',
18-
authToken,
19-
include: ['public'],
20-
stripPrefix: ['public/'],
21-
dryRun: process.env.NODE_ENV !== 'production',
22-
}),
23-
];
24-
};
25-
26-
function main({actions, reporter}) {
8+
function main({actions}) {
279
actions.setWebpackConfig({
2810
resolve: {
2911
fallback: {
@@ -34,7 +16,14 @@ function main({actions, reporter}) {
3416
'sentry-docs': path.join(path.resolve(__dirname, '..')),
3517
},
3618
},
37-
plugins: getPlugins(reporter),
19+
plugins: [
20+
sentryWebpackPlugin({
21+
org: 'sentry',
22+
project: 'docs',
23+
authToken: process.env.SENTRY_WEBPACK_PLUGIN_AUTH_TOKEN,
24+
sourcemaps: {assets: './public/**'},
25+
}),
26+
],
3827
});
3928
}
4029

0 commit comments

Comments
 (0)