Skip to content

Commit 150bc38

Browse files
authored
fix(nextjs): Remove logic merging include values in withSentryConfig (#4056)
This removes the logic which manipulates the user's webpack plugin options to include the nextjs config's `distDir` option (if set) in the plugin option's `include` property, as that manipulation results in more files than we want being uploaded (by essentially undoing #3845). A more selective version of this merging will be included in #4017.
1 parent e82a9bc commit 150bc38

File tree

3 files changed

+2
-250
lines changed

3 files changed

+2
-250
lines changed

packages/nextjs/src/config/index.ts

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import includeAllNextjsProps from './nextConfigToWebpackPluginConfig';
21
import { ExportedNextConfig, NextConfigFunction, NextConfigObject, SentryWebpackPluginOptions } from './types';
32
import { constructWebpackConfigFunction } from './webpack';
43

@@ -18,21 +17,16 @@ export function withSentryConfig(
1817
if (typeof userNextConfig === 'function') {
1918
return function(phase: string, defaults: { defaultConfig: NextConfigObject }): NextConfigObject {
2019
const materializedUserNextConfig = userNextConfig(phase, defaults);
21-
const sentryWebpackPluginOptionsWithSources = includeAllNextjsProps(
22-
materializedUserNextConfig,
23-
userSentryWebpackPluginOptions,
24-
);
2520
return {
2621
...materializedUserNextConfig,
27-
webpack: constructWebpackConfigFunction(materializedUserNextConfig, sentryWebpackPluginOptionsWithSources),
22+
webpack: constructWebpackConfigFunction(materializedUserNextConfig, userSentryWebpackPluginOptions),
2823
};
2924
};
3025
}
3126

32-
const webpackPluginOptionsWithSources = includeAllNextjsProps(userNextConfig, userSentryWebpackPluginOptions);
3327
// Otherwise, we can just merge their config with ours and return an object.
3428
return {
3529
...userNextConfig,
36-
webpack: constructWebpackConfigFunction(userNextConfig, webpackPluginOptionsWithSources),
30+
webpack: constructWebpackConfigFunction(userNextConfig, userSentryWebpackPluginOptions),
3731
};
3832
}

packages/nextjs/src/config/nextConfigToWebpackPluginConfig.ts

-125
This file was deleted.

packages/nextjs/test/config/nextConfigToWebpackPluginConfig.test.ts

-117
This file was deleted.

0 commit comments

Comments
 (0)