From be28fb8ed790255c730fe21b6f3d6dcc49fac681 Mon Sep 17 00:00:00 2001 From: Linus Rath <139418639+rathlinus@users.noreply.github.com> Date: Thu, 29 Oct 2026 20:08:54 +0100 Subject: [PATCH] fix: keep the production build's type check within 2 GB of memory #1431 --- next.config.ts | 6 ++++++ tsconfig.build.json | 24 ++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 tsconfig.build.json diff --git a/next.config.ts b/next.config.ts index f0572a81b..4e72c6948 100644 --- a/next.config.ts +++ b/next.config.ts @@ -61,6 +61,12 @@ const nextConfig: NextConfig = { // it from node_modules at runtime instead of trying to bundle it. Used by // PLUGIN_DEV_DIR's on-the-fly bundler. serverExternalPackages: ["esbuild"], + // The build's type check leaves out tests, which are a third of the files + // and push tsc past the default heap on a 4 GB machine (#1431). + // `npm run typecheck` still checks them with tsconfig.json. + typescript: { + tsconfigPath: "tsconfig.build.json", + }, // No proxyClientMaxBodySize: Next copies every body proxy.ts runs for up to // that size before routing, so it stays at the 10 MB default. The routes // that take bigger uploads (WOPI saves, WebDAV, /api/plugin-proxy) are left diff --git a/tsconfig.build.json b/tsconfig.build.json new file mode 100644 index 000000000..bf8d643aa --- /dev/null +++ b/tsconfig.build.json @@ -0,0 +1,24 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "typeRoots": [ + "./node_modules/@types" + ] + }, + "exclude": [ + "node_modules", + "repos", + "local-data", + "examples", + "integration", + ".next/dev/types", + "**/__tests__/**", + "**/*.test.ts", + "**/*.test.tsx", + "**/*.spec.ts", + "**/*.spec.tsx", + "vitest.config.ts", + "vitest.setup.ts", + "**/playwright*.config.ts" + ] +}