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

Hot reloading or automatic browser reload? #44

Open
tobyl opened this issue Feb 19, 2021 · 3 comments
Open

Hot reloading or automatic browser reload? #44

tobyl opened this issue Feb 19, 2021 · 3 comments

Comments

@tobyl
Copy link

tobyl commented Feb 19, 2021

Thanks so much for this, I was using django-webpack-loader but this is much simpler!

Do you have a recommendation for how to achieve automatic browser reloading when the assets are updated? I know this can be achieved using browsersync or livereload, but I'm hoping to not have to run a third process (on top of django server and webpack watch) during development.

Thanks again!

@rykener
Copy link
Owner

rykener commented Feb 26, 2021

Hi @tobyl, so glad you're enjoying this. If you'd like, I'd love to have the project shared with others who would use it. I feel it's the best solution out there at the moment for this problem.

There's not a great option for hot reloading that I'm aware of. What I do in one project is have a javascript interval running on the front end and querying an endpoint that returns the hashed filename. I then check this against my application state to determine if the filename has changed, and then if it has I execute a refresh through the javascript.

This is... a heavy-handed approach, but it does technically work.

@thisisnotmyuserid
Copy link

I was researching this a while back. Looks like anything with this kind of functionality has not seen any updates in a long time...

https://github.com/fabiogibson/django-livesync

https://github.com/tjwalch/django-livereload-server

And of course, no idea how these would play with manifest-loader.

@knokit
Copy link

knokit commented Mar 12, 2021

I'm using Webpack's devServer to serve my bundles with a proxy setup to redirect any other request to the Django server.

I think this is where I got the idea from, take a look: https://stackoverflow.com/a/58040422/1309785

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants