#does tauri automaticly bundle images or i need to ship the executable with the assets ?

20 messages · Page 1 of 1 (latest)

chrome belfry
#

?

oblique gust
#

If you are talking about images in Tauri folder, you need to include them in tauri.config.json resources list, you can find it here https://tauri.app/v1/guides/building/resources/

If you want you can still include resources inside of Rust code (but that will make bundle huge) with include_bytes macro

You may need to include additional files in your application bundle that aren't part of your frontend (your distDir) directly or which are too big to be inlined into the binary. We call these files resources.

#

both would execute in build time

chrome belfry
#

and why include_bytes is huge ? is it because the code behind it is conplex or what ?

oblique gust
# chrome belfry if i use the tauri.config.json will it be bundeled in the executable ?

if you use tauri.config.json resources it will be only included in installation so when user install your app. If you want Portable version of the app, it will not be included in .exe file.
include_bytes as the name says includes bytes of whatever you want inside of Rust 😄 so depending of size of image/images in bytes it will grow proportionally, making single .exe (portable) larger

chrome belfry
oblique gust
#

if your app is not offline only, you can also try loading those resources on the fly

chrome belfry
#

max 5mb

oblique gust
oblique gust
oblique gust
chrome belfry
oblique gust
#

if you are using those in nextjs you can bundle them with nextjs, they will be then bundled inside of exe with tauri from dist folder of nextjs app

chrome belfry
#

thanks for the help !

oblique gust
#

like public folder where you define static images, they will be embedded on build time of nextjs

#

np

chrome belfry
oblique gust
#

I think so