tauri
tauri copied to clipboard
feat: hot reload dev for static files
When I modify the front static file, I hope tauri dev
can automatically hot reload.
Hey @SOVLOOKUP ! Thanks for this suggestion. We've been talking about it and came to the conclusion we could work on such feature, probably once we've passed the security audit. :smile:
I use Live server in VSCode to and configure tauri.conf.json
to point to the default port of Live server like so 👇
{
"build": {
"devPath": "https://localhost:5500"
}
}
and I don't think tauri
should implement a custom live server, almost all programming languages and development environments have their own live server/dev server so it would be pointless to re-implement the same thing again.
Yeah Tauri would probably just leverage one of the existing dev servers libraries and expose it to the users. Live server
is a very good idea, I think we can close this and reopen if more people request this feature.
More people requesting this feature :)
I use Live server in VSCode to and configure
tauri.conf.json
to point to the default port of Live server
I use create-react-app
which already has it's fast reload - I guess it's the same principle as Live server (is it ?) and still my app is not reloading - do you have a trick for me @vsnthdev ? 😬
@arnaudambro Unless manually disabled, create-react-app
uses a technology called HMR (Hot module reloading) where only that particular component/function/element is resent through a websocket...
With the Live server VSCode extension, a JavaScript full-page refresh is triggered. Have your tried visiting http://localhost:5500 in your browser to check if reloading is working there?
actually it works good now ! I tried a few times before sending this message, not working, but today everything works like a charm... thanks !
I am working on vscode, and live server is running, but the window can't move by drag. btw, the titlebar has "data-tauri-drag-region", it works well while 'devPath: "../dist"'.
I am working on vscode, and live server is running, but the window can't move by drag. btw, the titlebar has "data-tauri-drag-region", it works well while 'devPath: "../dist"'.
Just wanted to add, I am using sveltekit for my web framework. It uses Vite to package up the JS and Vite also has HMR which seems to work as long as you point tauri.conf.json at the right devPath as was mentioned for live server.
I also think there should be an out-of-the-box solution that doesn't require additional setup from the user - at least for vanilla html documents.
Perhaps the VS Code extension can provide some interoperability?
This is an incredibly painful workflow. I'm trying to use vanilla js with the new import maps feature, and the build times are incredibly slow since I have to touch build.rs every time.