Skip to content

Commit 88a9922

Browse files
authored
feat(config) add withGlobalTauri conf description (tauri-apps#82)
1 parent a4af028 commit 88a9922

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

docs/api/config.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,17 @@ It's composed of the following properties:
2222
</div>`},
2323
{property: "devPath", type: "string", description: `Can be a path—either absolute or relative—to a folder or a URL (like a live reload server).`},
2424
{property: "beforeDevCommand", optional: true, type: "string", description: `A command to run before starting Tauri in dev mode.`},
25-
{property: "beforeBuildCommand", optional: true, type: "string", description: `A command to run before starting Tauri in build mode.`}
25+
{property: "beforeBuildCommand", optional: true, type: "string", description: `A command to run before starting Tauri in build mode.`},
26+
{property: "withGlobalTauri", optional: true, type: "boolean", description: "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."}
2627
]}/>
2728

2829
```js title=Example
2930
"build": {
3031
"distDir": "../dist",
3132
"devPath": "http://localhost:4000",
3233
"beforeDevCommand": "npm run dev",
33-
"beforeBuildCommand": "npm run build"
34+
"beforeBuildCommand": "npm run build",
35+
"withGlobalTauri": false
3436
}
3537
```
3638

docs/api/js.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ npm install tauri --save
2424
```js
2525
window.__TAURI__.dialog.open()
2626
```
27+
To enable it, set `tauri.conf.json > build > withGlobalTauri` to `true`.
2728
</Alert>
2829

2930
## Tauri

0 commit comments

Comments
 (0)