From c30af0032ba56bf68f9a411564fe3ab322133f82 Mon Sep 17 00:00:00 2001 From: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com> Date: Mon, 28 Feb 2022 09:39:39 -0800 Subject: [PATCH] Don't bundle large singular dependencies --- scripts/esbuild.js | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/scripts/esbuild.js b/scripts/esbuild.js index 2c413fdf1..fa7680aaa 100644 --- a/scripts/esbuild.js +++ b/scripts/esbuild.js @@ -28,23 +28,34 @@ const bundleDefaults = { }, bundle: true, external: [ + // Native libraries '@signalapp/signal-client', '@signalapp/signal-client/zkgroup', - 'backbone', 'better-sqlite3', + 'electron', 'fs-xattr', 'fsevents', - 'got', - 'jquery', 'mac-screen-capture-permissions', - 'node-fetch', - 'sass', - 'pino', - 'proxy-agent', 'ringrtc', + 'sass', 'sharp', 'websocket', - 'electron', + + // Things that don't bundle well + 'backbone', + 'got', + 'jquery', + 'node-fetch', + 'pino', + 'proxy-agent', + + // Large libraries (3.7mb total) + // See: https://esbuild.github.io/api/#analyze + 'emoji-datasource', + 'fabric', + 'google-libphonenumber', + 'moment', + 'quill', // Uses fast-glob and dynamic requires './preload_test',