From efefc6e6c19086662e8a512162eb35d596ed6a0d Mon Sep 17 00:00:00 2001 From: Thad Guidry Date: Wed, 11 Aug 2021 18:24:51 -0500 Subject: [PATCH] Add example of using allowlist to reduce binary size (#2111) * Add example of using allowlist to reduce binary size based on comment from@lucasfernog at https://discord.com/channels/616186924390023171/807549941936816148/859059694316683295 * fix example Co-authored-by: Lucas Nogueira --- docs/usage/guides/bundler/anti-bloat.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/docs/usage/guides/bundler/anti-bloat.md b/docs/usage/guides/bundler/anti-bloat.md index bea7e7397..7f50073f2 100644 --- a/docs/usage/guides/bundler/anti-bloat.md +++ b/docs/usage/guides/bundler/anti-bloat.md @@ -57,6 +57,31 @@ Binary size can easily be reduced by stripping out debugging information from bi See your local `strip` manpage for more information and flags that can be used to specify what information gets stripped out from the binary. +### Allowlist config + +You can also reduce the application size with the `allowlist` config, and only enabling what you need. Sometimes this is useful with Tauri's [Bridge-Pattern](/docs/usage/patterns/bridge) or others, depending on needs. + +For example in `tauri.conf.json` file: + +```json +{ + "tauri": { + "allowlist": { + "all": false, + "fs": { + "writeFile": true, + "writeBinaryFile": true + }, + "shell": { + "execute": true + }, + "dialog": { + "save": true + } + } + } +} +``` ### UPX