Skip to main content

Configuration

The tauri.conf.json is a file generated by the tauri init command (see here) that lives in your Tauri application source directory (src-tauri).

Once generated, you may modify it at will to customize your Tauri application.

Platform-specific configuration#

In addition to the JSON defined on the tauri.conf.json file, Tauri reads a platform-specific configuration on tauri.linux.conf.json, tauri.windows.conf.json and tauri.macos.conf.json and merges it with the main tauri.conf.json configuration.

Configuration structure#

tauri.conf.json is composed of the following properties:

build#

distDir: string
The path to the production-ready webpage/webapp directory (either absolute or relative to tauri.conf.json) that will be bundled by Tauri.
devPath: string
Can be a path to a folder (either absolute or relative to tauri.conf.json) or a URL (like a live reload server).
beforeDevCommand?: string
A command to run before starting Tauri in dev mode.
beforeBuildCommand?: string
A command to run before starting Tauri in build mode.
withGlobalTauri?: boolean
Enables the API injection to the window.__TAURI__ object. Useful if you're using Vanilla JS instead of importing the API using Rollup or Webpack. Reduces the command security since any external code can access it, so be careful with XSS attacks.
Example
"build": {
  "distDir": "../dist",
  "devPath": "http://localhost:4000",
  "beforeDevCommand": "npm run dev",
  "beforeBuildCommand": "npm run build",
  "withGlobalTauri": false
}

package#

productName?: string
Application name. The binary name is converted to snake-case on Linux.
version?: string
Application version.

tauri#

cli?: CliConfig
bundle: object
allowlist: object
windows: WindowConfig[]
security: object
Example
"tauri": {
  "cli": {
    "description": "Tauri communication example",
    "longDescription": null,
    "beforeHelp": null,
    "afterHelp": null,
    "args": [{
      "short": "c",
      "name": "config",
      "takesValue": true,
      "description": "Config path"
    }, {
      "short": "t",
      "name": "theme",
      "takesValue": true,
      "description": "App theme",
      "possibleValues": ["light", "dark", "system"]
    }, {
      "short": "v",
      "name": "verbose",
      "multipleOccurrences": true,
      "description": "Verbosity level"
    }],
    "subcommands": {
      "update": {
        "description": "Updates the app",
        "longDescription": null,
        "beforeHelp": null,
        "afterHelp": null,
        "args": [{
          "short": "b",
          "name": "background",
          "description": "Update in background"
        }],
        "subcommands": null
      }
    }
  },
  "bundle": {
    "active": true,
    "targets": ["deb"],
    "identifier": "com.tauri.dev",
    "icon": ["icons/32x32.png", "icons/128x128.png", "icons/128x128@2x.png", "icons/icon.icns", "icons/icon.ico"],
    "resources": [],
    "externalBin": [],
    "copyright": "",
    "category": "DeveloperTool",
    "shortDescription": "",
    "longDescription": "",
    "deb": {
      "depends": []
    },
    "macOS": {
      "frameworks": [],
      "minimumSystemVersion": "",
      "exceptionDomain": ""
    }
  },
  "allowlist": {
    "all": true
  },
  "windows": [{
    "title": "Tauri App",
    "width": 800,
    "height": 600,
    "resizable": true,
    "fullscreen": false
  }],
  "security": {
    "csp": "default-src blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self'"
  }
}