const { version } = require('../package.json'); const { i18n } = require('./next-i18next.config'); const { withSentryConfig } = require('@sentry/nextjs'); /** @type {import('next').NextConfig} */ const nextConfig = { reactStrictMode: true, i18n, env: { appVersion: version, }, images: { domains: ['cdn.rxresu.me', 'www.gravatar.com'], }, sentry: { hideSourceMaps: true, }, // Hack to make Tailwind darkMode 'class' strategy with CSS Modules // Ref: https://github.com/tailwindlabs/tailwindcss/issues/3258#issuecomment-968368156 webpack: (config) => { const rules = config.module.rules.find((r) => !!r.oneOf); rules.oneOf.forEach((loaders) => { if (Array.isArray(loaders.use)) { loaders.use.forEach((l) => { if (typeof l !== 'string' && typeof l.loader === 'string' && /(? { if (localName === 'dark') return localName; return getLocalIdent(ctx, localIdentName, localName, options); }, }, }; } }); } }); return config; }, }; /** @type {import('@sentry/nextjs').SentryWebpackPluginOptions} */ const sentryConfig = { silent: true, authToken: process.env.SENTRY_AUTH_TOKEN, dryRun: process.env.NODE_ENV !== 'production', }; module.exports = withSentryConfig(nextConfig, sentryConfig);