Skip to content

Commit 938c265

Browse files
rhysyngsunYour Name
and
Your Name
authored
Reduce memory usage for nextjs in dev mode (#2211)
Co-authored-by: Your Name <[email protected]>
1 parent c518814 commit 938c265

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

docker-compose.apps.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ services:
3636
command:
3737
- |
3838
yarn install --immutable
39-
yarn workspace ol-components storybook --no-open &
4039
yarn watch
4140
ports:
4241
- "8062:8062"

frontends/main/next.config.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,19 @@ const nextConfig = {
100100
env: {
101101
FEATURE_FLAGS: JSON.stringify(processFeatureFlags()),
102102
},
103+
104+
experimental: { webpackMemoryOptimizations: true },
105+
106+
webpack: (config, { dev }) => {
107+
if (dev) {
108+
config.cache = Object.freeze({
109+
type: "filesystem",
110+
allowCollectingMemory: true,
111+
})
112+
}
113+
// Important: return the modified config
114+
return config
115+
},
103116
}
104117

105118
// Injected content via Sentry wizard below

0 commit comments

Comments
 (0)