Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
"scripts": {
"build": "turbo run build",
"build-force": "pnpm clean && turbo run build --force",
"dev": "turbo run dev --parallel",
"dev": "NODE_OPTIONS='--max-old-space-size=8192' turbo run dev --parallel",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

This change introduces two significant issues: 1. Cross-platform compatibility: The NODE_OPTIONS='...' syntax is shell-specific and will fail on Windows Command Prompt (CMD). Since the project explicitly supports Windows (as seen in the start:windows script), this should be handled using run-script-os or a cross-platform utility. 2. Resource Exhaustion: Setting a high memory limit at the root level while using turbo --parallel means every task spawned by Turbo will inherit this 8GB limit. In a monorepo, this can quickly lead to system-wide Out-Of-Memory (OOM) errors if multiple tasks run concurrently. It is safer to apply this limit only to the specific package that requires it.

"start": "run-script-os",
"start:windows": "cd packages/server/bin && run start",
"start:default": "cd packages/server/bin && ./run start",
"start:default": "cd packages/server/bin && NODE_OPTIONS='--max-old-space-size=8192' ./run start",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Hardcoding 8192 (8GB) in package.json is a heavy-handed approach that affects all users. For Docker-based deployments, it is recommended to set the NODE_OPTIONS environment variable in the Dockerfile or docker-compose.yml instead. This allows for better flexibility and ensures that local development environments are not unnecessarily burdened with high memory defaults by default.

"clean": "pnpm --filter \"./packages/**\" clean",
"nuke": "pnpm --filter \"./packages/**\" nuke && rimraf node_modules .turbo",
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
Expand Down