mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-01 10:01:07 +02:00
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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user