Skip to content

Commit fea2480

Browse files
author
Luca Forstner
authored
feat(nextjs): Prefix webpack plugin log messages with runtime (#11173)
1 parent b4d7701 commit fea2480

File tree

3 files changed

+21
-16
lines changed

3 files changed

+21
-16
lines changed

packages/nextjs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
"@sentry/types": "8.0.0-alpha.4",
4343
"@sentry/utils": "8.0.0-alpha.4",
4444
"@sentry/vercel-edge": "8.0.0-alpha.4",
45-
"@sentry/webpack-plugin": "2.14.3",
45+
"@sentry/webpack-plugin": "2.16.0",
4646
"chalk": "3.0.0",
4747
"resolve": "1.22.8",
4848
"rollup": "3.29.4",

packages/nextjs/src/config/webpackPluginOptions.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ export function getWebpackPluginOptions(
1111
buildContext: BuildContext,
1212
sentryBuildOptions: SentryBuildOptions,
1313
): SentryWebpackPluginOptions {
14-
const { buildId, isServer, config: userNextConfig, dir: projectDir } = buildContext;
14+
const { buildId, isServer, config: userNextConfig, dir: projectDir, nextRuntime } = buildContext;
15+
16+
const prefixInsert = !isServer ? 'Client' : nextRuntime === 'edge' ? 'Edge' : 'Node.js';
1517

1618
const distDirAbsPath = path.join(projectDir, (userNextConfig as NextConfigObject).distDir || '.next'); // `.next` is the default directory
1719

@@ -89,6 +91,9 @@ export function getWebpackPluginOptions(
8991
deploy: sentryBuildOptions.release?.deploy,
9092
...sentryBuildOptions.unstable_sentryWebpackPluginOptions?.release,
9193
},
94+
_metaOptions: {
95+
loggerPrefixOverride: `[@sentry/nextjs - ${prefixInsert}]`,
96+
},
9297
...sentryBuildOptions.unstable_sentryWebpackPluginOptions,
9398
};
9499
}

yarn.lock

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6156,10 +6156,10 @@
61566156
resolved "https://registry.yarnpkg.com/@sentry/babel-plugin-component-annotate/-/babel-plugin-component-annotate-2.14.2.tgz#d756bed93495e97a5a2aad56e2a6dc5020305adc"
61576157
integrity sha512-mFBVnIZmdMrpxo61rG5yf0WFt5VrRpy8cpIpJtT3mYkX9vDmcUZaZaD1ctv73iZF3QwaieVdn05Na5mWzZ8h/A==
61586158

6159-
"@sentry/babel-plugin-component-annotate@2.14.3":
6160-
version "2.14.3"
6161-
resolved "https://registry.yarnpkg.com/@sentry/babel-plugin-component-annotate/-/babel-plugin-component-annotate-2.14.3.tgz#7064d656e620e73c671f23815727475369ecc070"
6162-
integrity sha512-h0ONVTe8j3Ma2g5SMsl9ynmLZdCf+CupLF7PQ7n06K0L8dDtrHqo8yjsWaZSJf4InGrJ9HC4MaOSItbFjiTFLw==
6159+
"@sentry/babel-plugin-component-annotate@2.16.0":
6160+
version "2.16.0"
6161+
resolved "https://registry.yarnpkg.com/@sentry/babel-plugin-component-annotate/-/babel-plugin-component-annotate-2.16.0.tgz#c831713b85516fb3f9da2985836ddf444dc634e6"
6162+
integrity sha512-+uy1qPkA5MSNgJ0L9ur/vNTydfdHwHnBX2RQ+0thsvkqf90fU788YjkkXwUiBBNuqNyI69JiOW6frixAWy7oUg==
61636163

61646164
61656165
version "2.14.2"
@@ -6175,13 +6175,13 @@
61756175
magic-string "0.27.0"
61766176
unplugin "1.0.1"
61776177

6178-
"@sentry/bundler-plugin-core@2.14.3":
6179-
version "2.14.3"
6180-
resolved "https://registry.yarnpkg.com/@sentry/bundler-plugin-core/-/bundler-plugin-core-2.14.3.tgz#b431361afb86dfb7330e4e1c593c6edc921139ee"
6181-
integrity sha512-iEtMdAPFUAYngvYhkfbgY8m3zB439u+5tvovj9rBXHGMr3nEB5fzZLOcVuiL47GEuUvMjDdrubl9MDGZ0c1IuQ==
6178+
"@sentry/bundler-plugin-core@2.16.0":
6179+
version "2.16.0"
6180+
resolved "https://registry.yarnpkg.com/@sentry/bundler-plugin-core/-/bundler-plugin-core-2.16.0.tgz#0c33e7a054fb56e43bd160ac141f71dfebf6dda5"
6181+
integrity sha512-dhgIZsIR3L9KnE2OO5JJm6hPtStAjEPYKQsZzxRr69uVhd9xAvfXeXr0afKVNVEcIDksas6yMgHqwQ2wOXFIAg==
61826182
dependencies:
61836183
"@babel/core" "^7.18.5"
6184-
"@sentry/babel-plugin-component-annotate" "2.14.3"
6184+
"@sentry/babel-plugin-component-annotate" "2.16.0"
61856185
"@sentry/cli" "^2.22.3"
61866186
dotenv "^16.3.1"
61876187
find-up "^5.0.0"
@@ -6270,12 +6270,12 @@
62706270
dependencies:
62716271
"@sentry/cli" "^1.74.4"
62726272

6273-
"@sentry/webpack-plugin@2.14.3":
6274-
version "2.14.3"
6275-
resolved "https://registry.yarnpkg.com/@sentry/webpack-plugin/-/webpack-plugin-2.14.3.tgz#b392d53381115528537355d0eb1a8cf8189662ce"
6276-
integrity sha512-3nsaBqdC2MJ+06BsCa5IwJIFaODT4UJis9+MSyuPLF+Ics+K3le4dlOCl8mc2Xm0WjqJUTlUmwvTj+jasnGMUw==
6273+
"@sentry/webpack-plugin@2.16.0":
6274+
version "2.16.0"
6275+
resolved "https://registry.yarnpkg.com/@sentry/webpack-plugin/-/webpack-plugin-2.16.0.tgz#4764577edb10c9575a8b4ce03135493f995f56b9"
6276+
integrity sha512-BeKLmtK4OD9V3j92fm/lm6yp+++s2U5Uf17HwNFGt39PEOq+wUDISsx0dhXA5Qls2Bg3WhguDK71blCaVefMeg==
62776277
dependencies:
6278-
"@sentry/bundler-plugin-core" "2.14.3"
6278+
"@sentry/bundler-plugin-core" "2.16.0"
62796279
unplugin "1.0.1"
62806280
uuid "^9.0.0"
62816281

0 commit comments

Comments
 (0)