tauri://localhost clarification #12667
-
Currently I am using the resources in the tauri.conf.json in order for me to have access to assets that will be used by the elements later on but so far I am having a hard time figuring out where to access those files. I see them being loaded whenever I run the setup for the release build but I am not sure how to access them with js, I have read some threads that they used tauri://localhost, but I am not sure what is the correct way to add it here is my current setup:
I am currently linking them like this:
If there is a way with just using js that would be awesome, thanks in advance for the help! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
I already checked the v2 version for this which uses object data type now instead of the array, but it just throws error whenever I build the app: |
Beta Was this translation helpful? Give feedback.
-
resources are generally not available via the The
Not exactly sure what you mean tbh, but considering that those files are in your ../src path you should be able to simply import them in your js files. |
Beta Was this translation helpful? Give feedback.
resources are generally not available via the
tauri://
schemel.tauri://
servers only files that are part of yourfrontendDist
so it may work here by accident if ../src is in there too but it's kindaaa undefined behavior (i'd expect the paths not to match)The
asset://
protocol (viaconvertFileSrc()
) can handle resources (but not files in yourfrontendDist
)Not exactly sure what you mean tbh, but considering that those files are in your ../src path you should be able to simply import them in your js files.