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 <lucas@tauri.studio>
This commit is contained in:
Thad Guidry
2021-08-11 18:24:51 -05:00
committed by GitHub
parent af72e8e690
commit efefc6e6c1

View File

@@ -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