Skip to content

Commit 016fc1b

Browse files
lobsterkatieLms24
authored andcommitted
create type for sentry options in userNextConfig
1 parent 22df479 commit 016fc1b

File tree

1 file changed

+18
-15
lines changed

1 file changed

+18
-15
lines changed

packages/nextjs/src/config/types.ts

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,29 @@ 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-
// Force webpack to apply the same transpilation rules to the SDK code as apply to user code. Helpful when targeting
26-
// older browsers which don't support ES6 (or ES6+ features like object spread).
27-
transpileClientSDK?: boolean;
28-
// Upload files from `<distDir>/static/chunks` rather than `<distDir>/static/chunks/pages`. Usually files outside of
29-
// `pages/` only contain third-party code, but in cases where they contain user code, restricting the webpack
30-
// plugin's upload breaks sourcemaps for those user-code-containing files, because it keeps them from being
31-
// 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
32-
// up uploading too many files, which is why this defaults to `false`.
33-
widenClientFileUpload?: boolean;
34-
};
20+
sentry?: UserSentryOptions;
3521
} & {
3622
// other `next.config.js` options
3723
[key: string]: unknown;
3824
};
3925

26+
export type UserSentryOptions = {
27+
disableServerWebpackPlugin?: boolean;
28+
disableClientWebpackPlugin?: boolean;
29+
hideSourceMaps?: boolean;
30+
31+
// Force webpack to apply the same transpilation rules to the SDK code as apply to user code. Helpful when targeting
32+
// older browsers which don't support ES6 (or ES6+ features like object spread).
33+
transpileClientSDK?: boolean;
34+
35+
// Upload files from `<distDir>/static/chunks` rather than `<distDir>/static/chunks/pages`. Usually files outside of
36+
// `pages/` only contain third-party code, but in cases where they contain user code, restricting the webpack
37+
// plugin's upload breaks sourcemaps for those user-code-containing files, because it keeps them from being
38+
// 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
39+
// up uploading too many files, which is why this defaults to `false`.
40+
widenClientFileUpload?: boolean;
41+
};
42+
4043
export type NextConfigFunction = (
4144
phase: string,
4245
defaults: { defaultConfig: NextConfigObject },

0 commit comments

Comments
 (0)