File tree Expand file tree Collapse file tree 1 file changed +18
-4
lines changed
src/content/docs/start/frontend Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Original file line number Diff line number Diff 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_*' ],
You can’t perform that action at this time.
0 commit comments