File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
packages/nextjs/src/config Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,13 @@ export { SentryWebpackPlugin };
27
27
// TODO: merge default SentryWebpackPlugin include with their SentryWebpackPlugin include
28
28
// TODO: drop merged keys from override check? `includeDefaults` option?
29
29
30
+ // In order to make sure that build-time code isn't getting bundled in runtime bundles (specifically, in the serverless
31
+ // functions into which nextjs converts a user's routes), we exclude this module (and all of its dependencies) from the
32
+ // nft file manifests nextjs generates. (See the code dealing with the `TraceEntryPointsPlugin` below.) So that we don't
33
+ // crash people, we therefore need to make sure nothing tries to either require this file or import from it. Setting
34
+ // this env variable allows us to test whether or not that's happened.
35
+ process . env . SENTRY_WEBPACK_MODULE_LOADED = 'true' ;
36
+
30
37
/**
31
38
* Construct the function which will be used as the nextjs config's `webpack` value.
32
39
*
You can’t perform that action at this time.
0 commit comments