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

How to add support for browser refresh when changes on a tsx? #1

Open
iberodev opened this issue Aug 4, 2019 · 2 comments
Open

How to add support for browser refresh when changes on a tsx? #1

iberodev opened this issue Aug 4, 2019 · 2 comments

Comments

@iberodev
Copy link

iberodev commented Aug 4, 2019

Hi, I've followed the samples (maybe I'm missing something).
When I run #npm run start-dev I can see nodemon executes and "watches" bundle.js and server.js

However, if I change any of my tsx, nodemon does not become aware of any change.
What's the best way for nodemon to become aware of this? Should "something" recompile and re-publish bundle.js and server.js whenever there is a change?

If so, nodemon is about restarting node server, but how can we achieve refreshing the browser automatically?

Thanks, very useful boilerplate

@iberodev
Copy link
Author

iberodev commented Aug 4, 2019

Ok, I forgot about npm run build-dev srcipt, If we execute that and then run npm run start-dev it seems webpack will rebuild and as soon as it's done, the server.js will be modified and nodemon will restart the server.

The only missin piece would then be refreshing the browser automatically when this happens. I have seen examples about this somewhere (I'm new to modern front-end) but maybe this is not so simple when using server side rendering. If you could clarify this, it would be very helpful. Thanks!

@Sheing
Copy link

Sheing commented Oct 8, 2019

add the watch flag. e.g: npm run start-dev watch, then you will have live reloading @iberodev

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

No branches or pull requests

2 participants