How to customize the tauri dev/build command #4964
-
I have built the app with vite for frontend. {
"scripts": {
"dev": "vite --mode development",
"build": "vite build",
} I also set my {
"build": {
"distDir": "../dist",
"devPath": "http://localhost:3000",
"beforeDevCommand": "yarn dev",
"beforeBuildCommand": "yarn build"
}
} So that when I run |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
First of all, this is not directly possible, but you can workaround it; Alternatively you can create a second tauri config which looks like this {
"build": {
"beforeDevCommand": "yarn dev --mode staging"
}
} And invoke it by using something like As a last resort you could just run the commands in 2 different terminals. |
Beta Was this translation helpful? Give feedback.
First of all, this is not directly possible, but you can workaround it;
I think the easiest way would be to not use beforeDevCommand at all, and instead do it inside the package.json scripts via https://www.npmjs.com/package/concurrently or https://www.npmjs.com/package/npm-run-all.
Alternatively you can create a second tauri config which looks like this
And invoke it by using something like
yarn tauri dev -c staging.json
.As a last resort you could just run the commands in 2 different terminals.