how best to build multiple Tauri2 desktop apps from a monorepo? #13941
-
|
(Not sure if this goes in Issues or Discussions ...) I want to deliver 2 different desktop apps that share lots of code, built from same git monorepo. To start with a very practical issue: how do I generate 2 sets of icons? Right now they live in /src-tauri/icons/ but there's only 1 of those. (We will experiment with things and share results -- but I also wanted to ask the community. FYI: our js tech stack is lightweight, e.g. no React or next.js or similar. Does use CodeMirror and thus vite. Also Brython which so far is amazing, though took some work to fit with vite.) Maybe something like this? But how do I indicate this to various dev/build steps? Does Rust And/or |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
|
For the icons you'll probably have to use the ngl i would probably do it differently than what i understand from your file tree. I'd just create 2 actual tauri apps each with their own icons folder and tauri.conf.json file (removing the src-tauri dir you have besides app1 and app2 rn). Then do the code sharing via some other shared crate. Until we support something like cargo's --manifest-path option you'll have to cd into the app you want to dev/build though for tauri's commands to work. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for a quick reply. "2 actual tauri apps" i.e. That was my first attempt, as 2 repos. app2 is a clone of app1, and I run a script which updates product name, version & http port in: Maybe that's better than monorepo at this point. |
Beta Was this translation helpful? Give feedback.
-
But the apps are nearly identical. They only differ by settings files (and feature flags based on app name), and then icons + debug or build output. e.g. if I add a dependency, I want to add in one place not to separate I don't mind workarounds; just trying to figure what options exist.
Fair point. I've learned enough Tauri & Rust & Cargo to get things working on my machine, but many of the details are still 'black box' magic. In the default (I think) folder structure, |
Beta Was this translation helpful? Give feedback.
-
Got it. Reference for me and thread viewers: https://v2.tauri.app/develop/configuration-files/#extending-the-configuration Is there a similar mechanism to merge additional dependencies for |
Beta Was this translation helpful? Give feedback.
In the case the
--configflag approach sounds more reasonable to me. You'll have 1 base/main tauri.conf.json and then 1 or 2 overwrite configs you specify via that flag that then gets merged into the main one (since they're merged they don't need to be complete configs, only what you want overwritten).