-
Notifications
You must be signed in to change notification settings - Fork 415
feat: add Netlify deployment config for Console frontend #2362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 6 commits
d2f5d42
ed9d2c5
d588f91
0a01be8
44d329f
df13b7e
286d804
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| [build] | ||
| base = "frontend" | ||
| # NODE_OPTIONS: 16 GB is a V8 heap ceiling guard, not actual memory usage. | ||
| # It prevents OOM kills during large builds; real RSS stays well below this. | ||
| command = "bun install && NODE_OPTIONS=--max_old_space_size=16384 bun run build" | ||
| publish = "build" | ||
|
|
||
| [build.environment] | ||
| NODE_VERSION = "22" | ||
| BUN_VERSION = "1.3.11" | ||
|
|
||
| [[headers]] | ||
| for = "/*" | ||
| [headers.values] | ||
| X-Content-Type-Options = "nosniff" | ||
|
|
||
| # MF remote entry — never cached, CORS required for cross-origin import | ||
| [[headers]] | ||
| for = "/embedded.js" | ||
| [headers.values] | ||
| Cache-Control = "no-cache, no-store, must-revalidate" | ||
| Access-Control-Allow-Origin = "*" | ||
| Access-Control-Allow-Methods = "GET, OPTIONS" | ||
| Access-Control-Allow-Headers = "*" | ||
| Access-Control-Max-Age = "86400" | ||
|
|
||
| # MF manifest — never cached, CORS required for cross-origin fetch | ||
| [[headers]] | ||
| for = "/mf-manifest.json" | ||
| [headers.values] | ||
| Cache-Control = "no-cache, no-store, must-revalidate" | ||
| Access-Control-Allow-Origin = "*" | ||
| Access-Control-Allow-Methods = "GET, OPTIONS" | ||
| Access-Control-Allow-Headers = "*" | ||
| Access-Control-Max-Age = "86400" | ||
|
|
||
| # Hashed static assets are immutable, CORS required for cross-origin import | ||
| [[headers]] | ||
| for = "/static/*" | ||
| [headers.values] | ||
| Cache-Control = "public, max-age=31536000, immutable" | ||
| Access-Control-Allow-Origin = "*" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this how we manage it normally, could we enable CORS only for the specific domains ?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good question. For Module Federation, the host app (Cloud UI on We could restrict to specific domains (e.g.,
The wildcard is scoped to only the MF entry points ( |
||
| Access-Control-Allow-Methods = "GET, OPTIONS" | ||
| Access-Control-Allow-Headers = "*" | ||
| Access-Control-Max-Age = "86400" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # SPA fallback for standalone mode. In embedded (MF) mode, only | ||
| # remoteEntry.js/embedded.js and chunks are fetched. | ||
| /* /index.html 200 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we charged by memory consumption in builds? having a high node old space size could be hiding some bugs.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. The
--max_old_space_size=16384is a V8 heap ceiling, not actual memory allocation — it just raises the limit before V8 triggers an OOM. The actual RSS during a Console build is typically 2-4 GB.Netlify doesn't charge by memory consumption — builds run on shared VMs with a fixed time limit. The risk of a high ceiling is exactly what you said: it could mask a memory leak in the bundler that would otherwise surface as an OOM.
That said, other app's Netlify build uses
NODE_OPTIONS=--max_old_space_size=4096(seenetlify.toml). We could lower this to 4096 or 8192 to be more conservative while still avoiding legitimate OOM during large builds.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lowered to 4096 in 286d804 to match Cloud UI's pattern.