Create a tauri app using cra template directly.

Create tauri app

1
yarn create tauri-app

It will install create-tauri-app

Set infos and template

It will prompt the following questions.

  1. App name
  2. Window title
  3. UI framework(vite, cra, vue, svelte, solid, angular, vanilla, clojure, …)
  4. Optional options for selected UI framework, such as javascript or typescript.

Run

It will create a simple script in package.json but cannot be executed directly.

  1. Execute command: yarn tauri dev to start tauri in dev mode.
  2. Execute command: yarn build && yarn tauri build to build application in product mode.

You can add scripts in package.json:

1
2
3
4
"scripts":{
"tauri-dev": "tauri dev",
"tauri-build": "yarn build && tauri build"
}

And run: yarn tauri-dev