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.
It's composed of the following properties:
build
distDir: string
The path—either absolute or relative—to the production-ready webpage/webapp directory that will be bundled by Tauri.
The target directory must contain an index.html file.
devPath: string
Can be a path—either absolute or relative—to a folder 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.
Example
"build": {
"distDir": "../dist",
"devPath": "http://localhost:4000",
"beforeDevCommand": "npm run dev",
"beforeBuildCommand": "npm run build",
"withGlobalTauri": false
}
ctx
debug?: boolean
Tells the CLI to build on debug mode instead of release. Can also be used as
tauri build --debug
.exitOnPanic?: boolean
Whether or not the webview should be killed if some Rust code error happened. Can also be used as
tauri dev --exit-on-panic
or tauri dev -e
.Example
"ctx" {
"debug": false,
"exitOnPanic": false,
}
tauri
cli?: CliConfig
embeddedServer: object
bundle: object
allowlist: object
window: object
security: object
inliner: object
bootstrapper script
Instead of launching the app directly, we configure the bundled app to run a script that tries to expose the environment variables to the app; without that you'll have trouble using system CLI apps like Node.js.
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
}
}
},
"embeddedServer": {
"active": true
},
"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": []
},
"osx": {
"frameworks": [],
"minimumSystemVersion": ""
},
"exceptionDomain": ""
},
"allowlist": {
"all": true
},
"window": {
"title": "Tauri App",
"width": 800,
"height": 600,
"resizable": true,
"fullscreen": false
},
"security": {
"csp": "default-src blob: data: filesystem: ws: http: https: 'unsafe-eval' 'unsafe-inline'"
},
"inliner": {
"active": true
}
}