Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'config/helpers/incremental_webpack_compiler/index.js')
-rw-r--r--config/helpers/incremental_webpack_compiler/index.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/config/helpers/incremental_webpack_compiler/index.js b/config/helpers/incremental_webpack_compiler/index.js
new file mode 100644
index 00000000000..81826607490
--- /dev/null
+++ b/config/helpers/incremental_webpack_compiler/index.js
@@ -0,0 +1,17 @@
+const { NoopCompiler, HistoryOnlyCompiler, IncrementalWebpackCompiler } = require('./compiler');
+const log = require('./log');
+
+module.exports = (recordHistory, enabled, historyFilePath, ttl) => {
+ if (!recordHistory) {
+ log(`Status – disabled`);
+ return new NoopCompiler();
+ }
+
+ if (enabled) {
+ log(`Status – enabled, ttl=${ttl}`);
+ return new IncrementalWebpackCompiler(historyFilePath, ttl);
+ }
+
+ log(`Status – history-only`);
+ return new HistoryOnlyCompiler(historyFilePath);
+};