Add LRU-like behaviour to incremental compilation
This adds least-recently-used-cache-like behaviour to the incremental webpack compiler. The `DEV_SERVER_INCREMENTAL_TTL` environment variable now determines the number of days that page bundles are considered "recent", and should be eagerly compiled. This number represents the trade-off between lazy/eager compilation versus low/high memory consumption of the webpack development server. A higher number means fewer pages needing to be compiled on demand, at the cost of higher memory consumption. A lower number means lower memory consumption, at the cost of more pages being compiled on demand. A value of `0` means that all pages in your history, regardless of how long ago you visited them, are eagerly compiled. This also makes the compiler record a history of visited pages even when disabled, so that if and when it _is_ enabled, that history can still be used to inform the LRU cache. The history-recording function is explicitly disabled in the case that webpack is running in CI. Part of https://gitlab.com/gitlab-org/gitlab/-/issues/300412.
显示
- config/helpers/incremental_webpack_compiler.js 0 个添加, 131 个删除config/helpers/incremental_webpack_compiler.js
- config/helpers/incremental_webpack_compiler/compiler.js 117 个添加, 0 个删除config/helpers/incremental_webpack_compiler/compiler.js
- config/helpers/incremental_webpack_compiler/history.js 125 个添加, 0 个删除config/helpers/incremental_webpack_compiler/history.js
- config/helpers/incremental_webpack_compiler/index.js 17 个添加, 0 个删除config/helpers/incremental_webpack_compiler/index.js
- config/helpers/incremental_webpack_compiler/log.js 3 个添加, 0 个删除config/helpers/incremental_webpack_compiler/log.js
- config/webpack.config.js 4 个添加, 0 个删除config/webpack.config.js
加载中
想要评论请 注册 或 登录