Skip to content

Commit 8259c26

Browse files
docs: update /start/frontented/vite.mdx (#3189)
Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>
1 parent 3ac6829 commit 8259c26

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

src/content/docs/start/frontend/vite.mdx

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This guide is accurate as of Vite 5.4.8.
1313

1414
## Checklist
1515

16-
- Use `dist/` as `frontendDist` in `tauri.conf.json`.
16+
- Use `../dist` as `frontendDist` in `src-tauri/tauri.conf.json`.
1717
- Use `process.env.TAURI_DEV_HOST` as the development server host IP when set to run on iOS physical devices.
1818

1919
## Example configuration
@@ -27,8 +27,10 @@ This guide is accurate as of Vite 5.4.8.
2727
```json
2828
{
2929
"scripts": {
30-
"dev": "vite dev",
31-
"build": "vite build"
30+
"dev": "vite",
31+
"build": "tsc && vite build",
32+
"preview": "vite preview",
33+
"tauri": "tauri"
3234
}
3335
}
3436
```
@@ -115,11 +117,23 @@ This guide is accurate as of Vite 5.4.8.
115117
// prevent vite from obscuring rust errors
116118
clearScreen: false,
117119
server: {
120+
port: 1420,
118121
// Tauri expects a fixed port, fail if that port is not available
119122
strictPort: true,
120123
// if the host Tauri is expecting is set, use it
121124
host: host || false,
122-
port: 5173,
125+
hmr: host
126+
? {
127+
protocol: 'ws',
128+
host,
129+
port: 1421,
130+
}
131+
: undefined,
132+
133+
watch: {
134+
// tell vite to ignore watching `src-tauri`
135+
ignored: ['**/src-tauri/**'],
136+
},
123137
},
124138
// Env variables starting with the item of `envPrefix` will be exposed in tauri's source code through `import.meta.env`.
125139
envPrefix: ['VITE_', 'TAURI_ENV_*'],

0 commit comments

Comments
 (0)