Completely separate the actual Tauri structure from the Front-end (here svelte but can be any front end).
Also only depends on Cargo and not npm on Tauri's side.
If you only want to figure how to quickly do it on your own project :
- uninstall @tauri-apps/cli from node modules and install tauri-cli with cargo instead
- move the tauri-src (and rename if you want) on the same level as your previous root folder.
- modify the tauri.conf.json, here I used svelte
as the front folder name. Like so :
"build": {
"beforeBuildCommand": "cd ./svelte && npm run build",
"beforeDevCommand": "cd ./svelte && npm run dev",
"devPath": "http://localhost:5173",
"distDir": "../svelte/build/"
},
Before
.
└── MyProject /
├── node_modules
├── src
├── src-tauri
└── ...and so on
After
.
└── MyProject/
├── svelte/ (or any fitting name, but change accordingly in tauri.conf.json)
│ ├── node_modules
│ ├── src
│ └── ...and so on
└── tauri/ (was tauri-src)
├── src
├── tauri.conf.json
└── ...and so on
cargo install tauri-cli
npm install
inside the front-end directorytauri -> bundle -> identifier
inside tauri.config.json.cargo tauri dev
or cargo tauri build
from the tauri folder