feat(web): enable Next.js Turbopack for the web dev server (#2798)

The dev server runs on Next.js webpack by default. On a sizeable
monorepo like this one (19 locale files, many components, the i18n
content surface) webpack dev mode pushes the Node heap past the
default 4 GB ceiling and the process dies with 'Ineffective
mark-compacts near heap limit' after a few hot reloads, leaving the
desktop window pointing at a dead URL.

Switch the dev script to '--turbopack'. Next.js 16 ships Turbopack
as stable for dev, and apps/web/next.config.ts already declares
turbopack.root so the workspace resolution is consistent with the
webpack path. The build script is unchanged on purpose — this PR is
scoped to the dev server, where the OOM repro is.

In practice Turbopack runs the same dev workload with materially
lower steady-state heap usage (Rust-side bundling instead of
JavaScript-side webpack) and recovers faster on HMR, so a long dev
session no longer drifts toward the OOM ceiling.

Co-authored-by: nicejames <nicejames@gmail.com>
This commit is contained in:
leessju 2026-05-24 00:09:46 +09:00 committed by GitHub
parent ecfe9b9d10
commit eb88d41107
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -21,7 +21,7 @@
"src"
],
"scripts": {
"dev": "next dev",
"dev": "next dev --turbopack",
"build": "next build",
"build:sidecar": "tsc -p tsconfig.sidecar.json",
"typecheck": "tsc -b --noEmit",