Open Sidders22 opened 1 week ago
Resources are never bundled inside the application, we only bundle the files inside your distDir
which is the frontend assets and should be fairly small. Could you please show a minimal repro?
Here is my minimal repro: https://github.com/Sidders22/tauri-resource-issue
Describe the bug
Resource files are bundled twice: As an external file AND inline within the executable that launches the application. If a large file is set as a resource, this causes the built application to balloon in size.
Reproduction
Set any large file as a resource in
tauri.config.json > tauri > bundle > resources
and build it usingnpm run tauri build
.Expected behavior
I would expect a file that is set as a resource, and therefore preserved as an external (separate) file, is only bundled once in the final application.
Full
tauri info
outputStack trace
No response
Additional context
In my case, I have a 1GB file that needs to be accessed using absolute paths, and I therefore cannot do so if it is bundled inline in the executable. But if I set this file as a resource in tauri.config.json, it is bundled twice in the final application, causing its size to balloon unnecessarily. How can I prevent this from happening? And if I can't, how can I reference the same file if it is bundled inline?