// web2.0-frontend/next.config.js const { withSentryConfig } = require("@sentry/nextjs"); const withBundleAnalyzer = require("@next/bundle-analyzer")({ enabled: process.env.ANALYZE === "true", }); /** @type {import('next').NextConfig} */ const nextConfig = { compiler: { styledComponents: true, }, images: { remotePatterns: [ { protocol: "https", hostname: "api.sahkoinsinoorikilta.fi", }, { protocol: "https", hostname: "static.sahkoinsinoorikilta.fi", }, { protocol: "https", hostname: "api.dev.sahkoinsinoorikilta.fi", }, ], }, // Note: The 'sentry' key is removed from here as it is no longer supported in v8 }; // Sentry options are now passed as a single object in the second argument const sentryOptions = { // For all available options, see: // https://github.com/getsentry/sentry-webpack-plugin#options // Suppresses all logs silent: true, // Hides source maps from generated client bundles hideSourceMaps: true, // Automatically tree-shake Sentry logger statements to reduce bundle size disableLogger: true, // Upload a larger set of source maps for prettier stack traces (increases build time) widenClientFileUpload: true, // (Optional) You can add org and project if not set in environment variables // org: "your-org-slug", // project: "your-project-slug", }; // Wrap the config with Sentry first, then Bundle Analyzer module.exports = withBundleAnalyzer(withSentryConfig(nextConfig, sentryOptions));