Tauri Integration

1. Install Tauri JS Package as a Dependency:

cd project-folder

# Not required if you already have a package.json:
# npm init
# OR
# yarn init

yarn add tauri
# OR
npm install tauri --save

2. Initialize Tauri

yarn tauri init

This command will place a new folder in your current working directory, src-tauri.

└── src-tauri
    ├── .gitignore
    ├── Cargo.toml
    ├── rustfmt.toml
    ├── tauri.conf.json
    ├── icons
    │   ├── 128x128.png
    │   ├── 128x128@2x.png
    │   ├── 32x32.png
    │   ├── Square107x107Logo.png
    │   ├── Square142x142Logo.png
    │   ├── Square150x150Logo.png
    │   ├── Square284x284Logo.png
    │   ├── Square30x30Logo.png
    │   ├── Square310x310Logo.png
    │   ├── Square44x44Logo.png
    │   ├── Square71x71Logo.png
    │   ├── Square89x89Logo.png
    │   ├── StoreLogo.png
    │   ├── icon.icns
    │   ├── icon.ico
    │   └── icon.png
    └── src
        ├── build.rs
        ├── cmd.rs
        └── main.rs

3. Check tauri info to Make Sure Everything Is Set up Properly:

yarn tauri info

Which should return something like:

Operating System - Darwin(16.7.0) - darwin/x64

Node.js environment
  Node.js - 12.14.0
  tauri.js - 0.2.1

Rust environment
  rustc - 1.40.0
  cargo - 1.40.0
  tauri-cli - 0.1.2

Global packages
  NPM - 6.13.4
  yarn - 1.21.1

App directory structure
/.quasar
/build-tauri
/dist
/node_modules
/src

App
  tauri - 0.3.0
  mode - embedded-server
  build-type - bundle
  CSP - default-src data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline'
  Windows - Edge
  distDir - ../dist/spa
  devPath - http://localhost:7334

This information can be very helpful when triaging problems.

src-tauri/tauri.conf.json

Edit src-tauri/tauri.conf.json: Depending on your development setup, you will probably need to update two important entry points for tauri:

  • your bundled assets (distDir)
  • your development server (devPath)

See more about tauri.conf.json configuration here.

{
  "build": {
    "distDir": "../dist/spa",
    "devPath": "http://localhost:7334"
  }
}

Patterns

We've also defined prebuilt configurations called "Patterns". They may help you to customize Tauri to fit your needs. See more about patterns.

Vue CLI Plugin Tauri

If you are using Vue CLI 3/4, it is recommended to use the official CLI plugin.