From 40a93b9790be813d89266998d86bfb5648200172 Mon Sep 17 00:00:00 2001 From: Ugo Palatucci Date: Wed, 25 Feb 2026 14:47:46 +0100 Subject: [PATCH] Fix OOM during production webpack build Use transpileOnly in ts-loader to skip type checking during webpack compilation, significantly reducing memory usage. Also set NODE_OPTIONS=--max-old-space-size=4096 for the build script to match the pattern already used by the dev script. Co-authored-by: Cursor --- package.json | 2 +- webpack.config.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 852e5a0c..7428c6ce 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "scripts": { "clean": "rm -rf dist", "dev": "NODE_ENV=development NODE_OPTIONS=--max-old-space-size=8192 rm -rf dist && yarn ts-node ./node_modules/.bin/webpack serve --progress", - "build": "yarn clean && NODE_ENV=production yarn ts-node node_modules/.bin/webpack", + "build": "yarn clean && NODE_ENV=production NODE_OPTIONS=--max-old-space-size=4096 yarn ts-node node_modules/.bin/webpack", "build-dev": "yarn clean && yarn ts-node node_modules/.bin/webpack", "start": "yarn ts-node node_modules/.bin/webpack serve", "start-console": "./start-console.sh", diff --git a/webpack.config.ts b/webpack.config.ts index 0342b303..b75639c9 100644 --- a/webpack.config.ts +++ b/webpack.config.ts @@ -57,6 +57,7 @@ const config: Configuration = { loader: 'ts-loader', options: { configFile: path.resolve(__dirname, 'tsconfig.json'), + transpileOnly: true, }, }, ],