message: fix(nextjs): Fix incomplete merging of user config with Sentry config
diff: @@ -73,11 +73,18 @@ export function withSentryConfig(
  }
  return {
  - experimental: { plugins: true },
  + ...providedExports,
  + experimental: { ...(providedExports.experimental || {}), plugins: true },
  plugins: [...(providedExports.plugins || []), '@sentry/next-plugin-sentry'],
  productionBrowserSourceMaps: true,
  - webpack: (config, { dev }) => {
  - if (!dev) {
  + webpack: (originalConfig, options) => {
  + let config = originalConfig;
  +
  + if (typeof providedExports.webpack === 'function') {
  + config = providedExports.webpack(originalConfig, options);
  + }
  +
  + if (!options.dev) {
  // Ensure quality source maps in production. (Source maps aren't uploaded in dev, and besides, Next doesn't let
  // you change this is dev even if you want to - see
  // https://github.com/vercel/next.js/blob/master/errors/improper-devtool.md.)
  @@ -86,11 +93,12 @@ export function withSentryConfig(
  config.plugins.push(
  // TODO it's not clear how to do this better, but there *must* be a better way
  new ((SentryWebpackPlugin as unknown) as typeof defaultWebpackPlugin)({
  - dryRun: dev,
  + dryRun: options.dev,
  ...defaultWebpackPluginOptions,
  ...providedWebpackPluginOptions,
  }),
  );
  +
  return config;
  },
  };
  