mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 07:30:16 +08:00
DEV: Reduce Webpack memory use in development (#24387)
The default for webpack is to keep cached values indefinitely. In discourse, this unbound memory usage causes node to raise an OOM error after 50-100 rebuilds in development mode (with source maps enabled). Setting maxGenerations=1 means that the cache will be cleaned up regularly. With this change, I see no discernible increase in memory after 150+ rebuilds.
This commit is contained in:
parent
bb941cc850
commit
ed611a63ae
|
@ -139,6 +139,12 @@ module.exports = function (defaults) {
|
|||
output: {
|
||||
publicPath: "auto",
|
||||
},
|
||||
cache: isProduction
|
||||
? false
|
||||
: {
|
||||
type: "memory",
|
||||
maxGenerations: 1,
|
||||
},
|
||||
entry: {
|
||||
"assets/discourse.js/features/markdown-it.js": {
|
||||
import: "./static/markdown-it",
|
||||
|
|
Loading…
Reference in New Issue
Block a user