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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"scripts": {
"clean": "rm -rf dist",
"dev": "NODE_ENV=development NODE_OPTIONS=--max-old-space-size=8192 rm -rf dist && npm run ts-node -- ./node_modules/.bin/webpack serve --progress",
Copy link

@coderabbitai coderabbitai bot Feb 25, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Pre-existing bug: NODE_OPTIONS in dev does not reach webpack.

NODE_ENV=development NODE_OPTIONS=--max-old-space-size=8192 rm -rf dist && npm run ts-node -- ...webpack serve

In POSIX shell, KEY=val cmd1 && cmd2 scopes the env var to cmd1 only. Here NODE_OPTIONS=--max-old-space-size=8192 is scoped to rm -rf dist (not a Node.js process) and is silently ignored; it never reaches the npm run ts-node invocation. The webpack serve process in dev has been running without the intended 8192 MB heap limit.

The fix mirrors the corrected pattern from line 10:

🐛 Proposed fix
-"dev": "NODE_ENV=development NODE_OPTIONS=--max-old-space-size=8192 rm -rf dist && npm run ts-node -- ./node_modules/.bin/webpack serve --progress",
+"dev": "rm -rf dist && NODE_ENV=development NODE_OPTIONS=--max-old-space-size=8192 npm run ts-node -- ./node_modules/.bin/webpack serve --progress",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"dev": "NODE_ENV=development NODE_OPTIONS=--max-old-space-size=8192 rm -rf dist && npm run ts-node -- ./node_modules/.bin/webpack serve --progress",
"dev": "rm -rf dist && NODE_ENV=development NODE_OPTIONS=--max-old-space-size=8192 npm run ts-node -- ./node_modules/.bin/webpack serve --progress",
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@package.json` at line 9, The dev npm script currently scopes NODE_OPTIONS
only to the rm command because the env assignment precedes rm -rf dist; update
the "dev" script so NODE_OPTIONS is applied to the webpack serve invocation (the
entire chain) by moving the env assignment to prefix the npm run ts-node
invocation (i.e., ensure NODE_ENV=development and
NODE_OPTIONS=--max-old-space-size=8192 are set for npm run ts-node --
./node_modules/.bin/webpack serve) or alternatively use a cross-platform tool
like cross-env to export NODE_OPTIONS for the webpack serve process; modify the
"dev" script string accordingly so the webpack/ts-node process receives the 8192
MB heap limit.

Copy link
Contributor

Choose a reason for hiding this comment

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

We should change this to npm run clean && NODE_ENV=development NODE_OPTIONS=--max-old-space-size=8192 npm run ts-node -- ./node_modules/.bin/webpack serve --progress

Copy link

Choose a reason for hiding this comment

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

@adamviktora Excellent suggestion! Using npm run clean instead of rm -rf dist is indeed better because it:

  1. Maintains consistency with other scripts like build and build-dev which already use npm run clean
  2. Provides better abstraction – if the clean logic needs to change in the future, it only needs to be updated in one place
  3. Still fixes the NODE_OPTIONS scoping issue by placing the environment variables before the npm run ts-node invocation

Your proposed change properly ensures that both NODE_ENV and NODE_OPTIONS are scoped to the webpack serve process while keeping the script structure clean and maintainable.

"build": "npm run clean && NODE_ENV=production npm run ts-node -- node_modules/.bin/webpack",
"build": "npm run clean && NODE_ENV=production NODE_OPTIONS=--max-old-space-size=4096 npm run ts-node -- node_modules/.bin/webpack",
"build-dev": "npm run clean && npm run ts-node -- node_modules/.bin/webpack",
"start": "npm run ts-node -- node_modules/.bin/webpack serve",
"start-console": "./start-console.sh",
Expand Down