This is a template for building desktop applications with Tauri.
- Read the Tauri setup guide
- Latest version of Node
- Yarn package manager (alternatively, npm)
Create a new project using this template
Click the Use this template button.
- This template uses the latest versions of Tauri features.
- Build smaller, faster, and more secure desktop applications with a web frontend
- Vite is used to group all the source code of the renderer.
- Work easily with Vue, Svelte, React, etc.
- The Latest TypeScript is used for all source code.
- Vite supports TypeScript out of the box. However, it does not support type checking.
Note: If you do not need a TypeScript, you can easily abandon it. To do this, You do not need to make any bundler configuration changes, etc. Just replace all .ts
files with .js
files. Additionally, it will be useful to delete TS-specific files, plug-ins and dependencies like tsconfig.json
, @typescript-eslint/*
, etc.
By default this template is configured with vanilla-ts.
See examples of different frameworks.
The template required a minimum dependencies. Only Tauri and Vite is used for building, nothing more.
The structure of this template is very similar to the structure of a monorepo.
packages/src-tauri
Tauri application source.packages/src-renderer
Web application source.
yarn dev
The first time you run this command, it will take several minutes for the Rust package manager to download and build all the required packages. Since they are cached, subsequent builds will be much faster, as only your code will need rebuilding.
Once Rust has finished building, the webview will open and it should display your web app.
yarn build
This command will embed your web assets into a single binary with your Rust code. The binary itself will be located in packages/src-tauri/target/release/[app name]
, and installers will be located in packages/src-tauri/target/release/bundle/
.
Like the yarn dev
command, the first time you run this, it will take some time to collect the Rust crates and build everything - but on subsequent runs it will only need to rebuild your code, which is much quicker.
This project is licensed under the MIT License - see LICENSE for more information.
Copyright (c) 2021 Valmisson Grizorte.