diff --git a/web/Dockerfile b/web/Dockerfile index e0fa59dcfec..bf11cfb65ab 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -18,6 +18,9 @@ FROM base AS builder RUN apk add --no-cache libc6-compat WORKDIR /app +# Increase Node.js memory limit for the build process +ENV NODE_OPTIONS="--max-old-space-size=4096" + # pull in source code / package.json / package-lock.json COPY . . diff --git a/web/next.config.js b/web/next.config.js index 75fce8314a5..f32e8c985ed 100644 --- a/web/next.config.js +++ b/web/next.config.js @@ -38,6 +38,14 @@ const nextConfig = { }, ], }, + // Add these options to optimize the build + swcMinify: true, + experimental: { + optimizeCss: true, + // Disable unnecessary features + scrollRestoration: false, + legacyBrowsers: false, + }, async headers() { return [ { @@ -79,14 +87,17 @@ const sentryEnabled = Boolean( process.env.SENTRY_AUTH_TOKEN && process.env.NEXT_PUBLIC_SENTRY_DSN ); -// Sentry webpack plugin options +// Modify the Sentry webpack plugin options const sentryWebpackPluginOptions = { org: process.env.SENTRY_ORG || "onyx", project: process.env.SENTRY_PROJECT || "data-plane-web", authToken: process.env.SENTRY_AUTH_TOKEN, - silent: !sentryEnabled, // Silence output when Sentry is disabled - dryRun: !sentryEnabled, // Don't upload source maps when Sentry is disabled + silent: !sentryEnabled, + dryRun: !sentryEnabled, sourceMaps: false, + // Add this option to disable source map generation + disableServerWebpackPlugin: true, + disableClientWebpackPlugin: true, }; // Export the module with conditional Sentry configuration