Skip to content

Add dev config key to exclude specific files from triggering a reload - #13432

Draft
mkurz wants to merge 3 commits into
playframework:mainfrom
mkurz:playMonitoredFilesExcludes
Draft

mkurz wants to merge 3 commits into
playframework:mainfrom
mkurz:playMonitoredFilesExcludes

Conversation

@mkurz

@mkurz mkurz commented Jul 24, 2025

Copy link
Copy Markdown
Member

Depends on

In dev mode, when a files gets changed, the dev server will be restarted.

This PR allows to set a config in build.sbt like:

PlayKeys.playMonitoredFilesExcludes += baseDirectory.value / "conf" / "somefile"

which makes the file conf/somefile be ignored from the reload mechanism. So a change to this file (or deletion or newly creation of this file) will not trigger a reload.

play-file-watch uses directory-watcher underneath which can only watch directories, not files, therefore we also can not just exclude a file easily - this is why I came up with this approach.

@mkurz
mkurz marked this pull request as draft July 24, 2025 14:22
@mkurz
mkurz force-pushed the playMonitoredFilesExcludes branch from 505b7af to 28d87f2 Compare June 17, 2026 12:58
@mkurz
mkurz force-pushed the playMonitoredFilesExcludes branch from 28d87f2 to fff03cf Compare September 23, 2026 09:21
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.

1 participant