Skip to content

Conversation

@dengr1065
Copy link
Collaborator

Add a --watch command line flag to be used in tandem with --load-mod. Chokidar is used to detect file updates, and a page reload is triggered when there are any changes to watched mod files. Only mods loaded via --load-mod are affected.

This implementation has a minor issue with how cache is cleared - removing disk cache is a bit too aggressive - but the only alternative I could find is to use a non-persistent Electron session, which would get rid of disk cache entirely (this is not a concern).

The way watcher events are propagated is somewhat dirty (using an EventEmitter without any typings), but it's good enough in my opinion.

Add a --watch command line flag to be used in tandem with --load-mod.
Chokidar is used to detect file updates, and a page reload is triggered
when there are any changes to watched mod files. Only mods loaded via
--load-mod are affected.

This implementation has a minor issue with how cache is cleared -
removing disk cache is a bit too aggressive - but the only alternative I
could find is to use a non-persistent Electron session, which would get
rid of disk cache entirely (this is not a concern).
@dengr1065 dengr1065 merged commit 6c3f91e into master Jun 12, 2025
1 check passed
@dengr1065 dengr1065 deleted the dengr1065/moddev-watch-mode branch June 14, 2025 19:05
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

Successfully merging this pull request may close these issues.

2 participants