From 0a649b88d12528a17032cb55f4ac2e0018baa828 Mon Sep 17 00:00:00 2001 From: LeoTM <1881059+leotm@users.noreply.github.com> Date: Thu, 30 Nov 2023 11:06:17 +0000 Subject: [PATCH] refactor(ses): make go vroom faster --- packages/ses/scripts/bundle.js | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/packages/ses/scripts/bundle.js b/packages/ses/scripts/bundle.js index 61cd72682b..8ca86a0479 100644 --- a/packages/ses/scripts/bundle.js +++ b/packages/ses/scripts/bundle.js @@ -38,15 +38,21 @@ const main = async () => { console.log(`Minified bundle size: ${terse.length} bytes`); await fs.promises.mkdir('dist', { recursive: true }); - await write('dist/ses.cjs', versionedBundle); - await write('dist/ses.mjs', versionedBundle); - await write('dist/ses.umd.js', versionedBundle); - await write('dist/ses.umd.min.js', terse); - - await write('dist/lockdown.cjs', versionedBundle); - await write('dist/lockdown.mjs', versionedBundle); - await write('dist/lockdown.umd.js', versionedBundle); - await write('dist/lockdown.umd.min.js', terse); + + const bundles = [ + 'dist/ses.cjs', + 'dist/ses.mjs', + 'dist/ses.umd.js', + 'dist/lockdown.cjs', + 'dist/lockdown.mjs', + 'dist/lockdown.umd.js', + ]; + const terses = ['dist/ses.umd.min.js', 'dist/lockdown.umd.min.js']; + + await Promise.all([ + ...bundles.map(dest => write(dest, versionedBundle)), + ...terses.map(dest => write(dest, terse)), + ]); }; main().catch(err => {