From 36ca488c0632fad83406e90f1658d27dbd1f0e87 Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Tue, 30 Jan 2024 11:16:08 +0800 Subject: [PATCH] MDL-79003 js: Move rollup ratelimit to generateBundle There are two phases of a build: Building, and then Outputting. We were previously listening on the final event for the build phase, but we should be listening to the final event of the output phase. --- .grunt/tasks/javascript.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.grunt/tasks/javascript.js b/.grunt/tasks/javascript.js index 1243fff0b45..23c9caab581 100644 --- a/.grunt/tasks/javascript.js +++ b/.grunt/tasks/javascript.js @@ -103,6 +103,7 @@ module.exports = grunt => { // The queue runner will run the next `size` items in the queue. const runQueue = (size = 1) => { queue.splice(0, size).forEach(resolve => { + grunt.log.debug(`Item resolved. Kicking off next one.`); resolve(); }); }; @@ -112,15 +113,17 @@ module.exports = grunt => { // The options hook is run in parallel. // We can return an unresolved Promise which is queued for later resolution. - options: async() => { + options: async(options) => { return new Promise(resolve => { queue.push(resolve); startQueue(); + return options; }); }, // When an item in the queue completes, start the next item in the queue. - buildEnd: () => { + generateBundle: (options, bundle) => { + grunt.log.debug(`Finished output phase for ${Object.keys(bundle).join(', ')}`); runQueue(); }, };