Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: hot reload dev for static files #2173

Closed
SOVLOOKUP opened this issue Jul 7, 2021 · 12 comments
Closed

feat: hot reload dev for static files #2173

SOVLOOKUP opened this issue Jul 7, 2021 · 12 comments
Assignees
Labels
scope: cli.rs The tauri-cli rust crate status: backlog Issue is ready and we can work on it type: feature request

Comments

@SOVLOOKUP
Copy link

When I modify the front static file, I hope tauri dev can automatically hot reload.

@Laegel
Copy link
Member

Laegel commented Jul 8, 2021

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. 😄

@vsnthdev
Copy link

vsnthdev commented Aug 15, 2021

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.

@lucasfernog
Copy link
Member

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.

@rajbits
Copy link

rajbits commented Sep 24, 2021

More people requesting this feature :)

@arnaudambro
Copy link

arnaudambro commented Mar 23, 2022

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 ? 😬

@vsnthdev
Copy link

@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?

@arnaudambro
Copy link

actually it works good now ! I tried a few times before sending this message, not working, but today everything works like a charm... thanks !

@azwc
Copy link

azwc commented May 29, 2022

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"'.

1 similar comment
@azwc
Copy link

azwc commented May 29, 2022

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"'.

@sl0burn
Copy link

sl0burn commented Aug 8, 2022

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.

@ItsCubeTime
Copy link

ItsCubeTime commented Sep 8, 2022

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?

@fny
Copy link

fny commented Sep 19, 2022

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.

@amrbashir amrbashir reopened this Sep 20, 2022
@amrbashir amrbashir added scope: cli.rs The tauri-cli rust crate type: feature request status: backlog Issue is ready and we can work on it labels Sep 20, 2022
@amrbashir amrbashir self-assigned this Sep 20, 2022
@amrbashir amrbashir changed the title hot reload dev for static files feat: hot reload dev for static files Sep 20, 2022
@amrbashir amrbashir reopened this Sep 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: cli.rs The tauri-cli rust crate status: backlog Issue is ready and we can work on it type: feature request
Projects
None yet
Development

No branches or pull requests