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

Feature: Live reload #76

Closed
rizrmd opened this issue Aug 21, 2022 · 7 comments
Closed

Feature: Live reload #76

rizrmd opened this issue Aug 21, 2022 · 7 comments
Labels
discussion enhancement New feature or request

Comments

@rizrmd
Copy link

rizrmd commented Aug 21, 2022

Hi, Great Job!

It would be nice if jiti can watch current project and live reload it when some file changes.

@szmxx
Copy link

szmxx commented Sep 15, 2023

So far, does jiti support watch mode?

@pi0
Copy link
Member

pi0 commented Sep 15, 2023

@szmxx Not yet but you can try listhen CLI which gives you jiti powered watch mode for any dev server.

@szmxx
Copy link

szmxx commented Sep 15, 2023

@pi0 Looking forward, I will try

@noook
Copy link

noook commented Feb 28, 2024

This repository does not have discussions enabled, and it's not exactly an issue, more of a question / follow-up on the --watch flag usage when it comes to a Discord bot development.

I'm in the process of modernizing the tools and I immediately thought of jiti to run my app. However during development it is necessary to be able to watch and re-run the app on save instead of cancelling the process, and running it again.

@pi0 you mentioned that we can use listhen in the meanwhile, however I'm not sure whether it is the right tool for this use case ?

Another solution would be to simply use bun with the watch flag also. I'm curious what's your opinion on what's the best tool for this

@pi0
Copy link
Member

pi0 commented Feb 29, 2024

@noook If your app is a HTTP server, you can use listhen that uses jiti and does this. If it is not, you can easily create a watcher with @parcel/watcher and inside it use a jiti import with cache disabled. Also using bun --watch is a good alternative I sometimes do that too.

I like to introduce a similar feature of the bun to jiti core for live reload but it is mainly less of a priority now and the next goal is v2 (#174) so maybe after that in 2.x 👍🏼

@pi0 pi0 added enhancement New feature or request discussion labels Feb 29, 2024
@ericclemmons
Copy link

I've found https://github.com/pygy/esm-reload works pretty well, too.

@pi0
Copy link
Member

pi0 commented Sep 19, 2024

node --watch --import jiti/register should work with jiti v2. Introducing watcher would duplicate runtime efforts.

@pi0 pi0 closed this as not planned Won't fix, can't repro, duplicate, stale Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants