Skip to content

Commit 87eace1

Browse files
committed
create type for sentry options in userNextConfig
1 parent 96255d4 commit 87eace1

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

packages/nextjs/src/config/types.ts

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,25 @@ export type NextConfigObject = {
1717
target: 'server' | 'experimental-serverless-trace';
1818
// the output directory for the built app (defaults to ".next")
1919
distDir: string;
20-
sentry?: {
21-
disableServerWebpackPlugin?: boolean;
22-
disableClientWebpackPlugin?: boolean;
23-
hideSourceMaps?: boolean;
24-
25-
// Upload files from `<distDir>/static/chunks` rather than `<distDir>/static/chunks/pages`. Usually files outside of
26-
// `pages/` only contain third-party code, but in cases where they contain user code, restricting the webpack
27-
// plugin's upload breaks sourcemaps for those user-code-containing files, because it keeps them from being
28-
// uploaded. At the same time, we don't want to widen the scope if we don't have to, because we're guaranteed to end
29-
// up uploading too many files, which is why this defaults to `false`.
30-
widenClientFileUpload?: boolean;
31-
};
20+
sentry?: UserSentryOptions;
3221
} & {
3322
// other `next.config.js` options
3423
[key: string]: unknown;
3524
};
3625

26+
export type UserSentryOptions = {
27+
disableServerWebpackPlugin?: boolean;
28+
disableClientWebpackPlugin?: boolean;
29+
hideSourceMaps?: boolean;
30+
31+
// Upload files from `<distDir>/static/chunks` rather than `<distDir>/static/chunks/pages`. Usually files outside of
32+
// `pages/` only contain third-party code, but in cases where they contain user code, restricting the webpack
33+
// plugin's upload breaks sourcemaps for those user-code-containing files, because it keeps them from being
34+
// uploaded. At the same time, we don't want to widen the scope if we don't have to, because we're guaranteed to end
35+
// up uploading too many files, which is why this defaults to `false`.
36+
widenClientFileUpload?: boolean;
37+
};
38+
3739
export type NextConfigFunction = (
3840
phase: string,
3941
defaults: { defaultConfig: NextConfigObject },

0 commit comments

Comments
 (0)