From ff34277d67d915e5db53e168a466e203993ad266 Mon Sep 17 00:00:00 2001 From: "Brian R. Bondy" Date: Sun, 26 Mar 2017 01:04:42 -0400 Subject: [PATCH] Reduce installer size by file types Auditors: @aekeus Fix #7896 By ignoring by file type we can remove a lot of the redundant rules and catch things automatically as we add deps. I found this script on SO which lists all file types recursively `find . -type f | perl -ne 'print $1 if m/\.([^.\/]+)$/' | sort -u | gvim` http://stackoverflow.com/a/1842270/3153 After getting that list I exluded the things I think we need, and then bisected when there was a problem starting the browser. --- tools/lib/ignoredPaths.js | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/tools/lib/ignoredPaths.js b/tools/lib/ignoredPaths.js index cbcb28b1dd3..76d7a3edc39 100644 --- a/tools/lib/ignoredPaths.js +++ b/tools/lib/ignoredPaths.js @@ -14,18 +14,16 @@ module.exports = [ 'caniuse-db', 'cross-env', 'spectron', + '\\.(0|13ctype|APACHE2|BSD|DOCS|DS_Store|LESSER|Makefile|a|ac|aff|after|am|arcconfig|arclint|babelrc|bat|before|bnf|brave-gyp|c|cardinalrc|cc|cfg|closure-compiler|cmake|cmd|covignore|cpp|csv|cxx|d|def|deps|dic|dll|dntrc|dockerignore|dsp|editorconfig|editorconfig~|el|enc|entitlements|eot|esprima|flow|flowconfig|gitattributes|githug|gitignore|gitattributes|gitignore|gitkeep|gitmodules|gnu|gradle|gyp|gypi|gz|h|hbs|hxx|idl|iml|in|inc|include|info|jade|java|jsfmtrc|jshint|jshintignore|jshintrc|jslintrc|jst|js~|keep|lint|lintignore|lock|log|ls|m4|mailmap|map|markdown|md|mdown|md~|mem|min-wd|mk|mkd|mm|mustache|myspell|myspell|name|nsh|nsi|nsprc|nuspec|nvmrc|o|old|orig|otf|param|patch|pegjs|post|pre|pro|py|rej|s|sage|scss|settings|sh|skip|source-map|stamp|swo|tap|targ|template|tern-port|tern-project|testignore|tm_properties|tmp|tpl|ts|txt|un~|vscode|xcf|xml|yaml|yml)$', + '/deps/', + 'Release/obj', + 'obj.target', 'ad-block/(node_modules|test|perf|sample|scripts|test|vendor|ABPFilterParserData.dat)', - 'ad-block/build/Release/(obj|obj.target|.deps|ad-block.pdb|ad-block.map)', + 'leveldown/(node_modules|src|iojs)', 'tracking-protection/(node_modules|test|data|scripts|vendor)', 'tracking-protection/build/node_modules', - 'tracking-protection/build/Release/(tp_node_addon.pdb|sample.pdb|test.pdb|tp_node_addon.map|sample.map|test.map|hashset-cpp.map|sample.exe|test.exe)', - 'hashset-cpp/build/Release/(obj|hashset-cpp.pdb|hashset-cpp.map)', - 'bloom-filter-cpp/build/Release/(obj|bloom-filter-cpp.map|bloom-filter-cpp.pdb)', - 'keytar/build/Release/(obj|keytar.pdb|keytar.map)', - 'spellchecker/build/Release/(obj|spellchecker.pdb|spellchecker.map)', - 'sqlite3/(src|deps)', - 'sqlite3/build/Release/(obj|obj.target|.deps)', - 'tracking-protection/build/Release/(obj|obj.target|.deps|hashset-cpp.pdb)', + 'tracking-protection/build/Release/(sample.exe|test.exe)', + 'sqlite3/src', 'nsp/node_modules', 'electron-installer-squirrel-windows', 'electron-chromedriver', @@ -33,9 +31,6 @@ module.exports = [ 'node-notifier/vendor', 'node-gyp', 'npm', - '.brave-gyp', - '.vscode', - '.github', 'jsdoc', 'docs', 'sinon',