From 0b1f80179c4d3c7476fc16271cc9022706319c5e Mon Sep 17 00:00:00 2001 From: Max Duval Date: Mon, 24 Jun 2024 14:23:49 +0100 Subject: [PATCH] refactor: clearer export --- tools/webpack-progress-reporter.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/webpack-progress-reporter.js b/tools/webpack-progress-reporter.js index b4abf472309..db9330f06f4 100644 --- a/tools/webpack-progress-reporter.js +++ b/tools/webpack-progress-reporter.js @@ -1,8 +1,10 @@ const ProgressPlugin = require('webpack/lib/ProgressPlugin'); -module.exports = (observer) => +const reporter = (observer) => new ProgressPlugin((progress, msg, ...details) => { const [a, b] = details; const state = a && b ? `[${a}, ${b}]` : ''; return observer.next(`${Math.round(progress * 100)}% ${msg} ${state}`); }); + +module.exports = reporter;