From c0cb19fb9f69e4bd6aeccf6961e538e51f71d773 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Thu, 10 Mar 2016 18:48:08 -0800 Subject: [PATCH] Shrink Electron bundle size by lots of MBs! --- bin/package.js | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/package.js b/bin/package.js index 1a3ba31a..4a524753 100755 --- a/bin/package.js +++ b/bin/package.js @@ -33,7 +33,7 @@ var all = { // Pattern which specifies which files to ignore when copying files to create the // package(s). - ignore: /^\/(dist|static\/screenshot.png)$/, + ignore: /^\/dist|\/(appveyor.yml|AUTHORS|CONTRIBUTORS|bench|benchmark|benchmark\.js|bin|bower\.json|component\.json|coverage|doc|docs|docs\.mli|dragdrop\.min\.js|example|examples|example\.html|example\.js|externs|ipaddr\.min\.js|Makefile|min|minimist|perf|rusha|simplepeer\.min\.js|simplewebsocket\.min\.js|static\/screenshot\.png|test|tests|test\.js|tests\.js|webtorrent\.min\.js|ws|\.[^\/]*|.*\.md|.*\.markdown)$/, // The application name. name: config.APP_NAME, diff --git a/package.json b/package.json index c5a5df97..7c5cf634 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "scripts": { "cleanup": "node ./bin/cleanup.js", "debug": "DEBUG=* electron .", - "package": "node ./bin/package.js", + "package": "npm prune && npm dedupe && node ./bin/package.js", "start": "electron .", "test": "standard", "update-authors": "./bin/update-authors.sh"