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

Add a property for configuring additional livereload paths #40342

Open
metaforte opened this issue Apr 13, 2024 · 1 comment
Open

Add a property for configuring additional livereload paths #40342

metaforte opened this issue Apr 13, 2024 · 1 comment
Labels
type: enhancement A general enhancement
Milestone

Comments

@metaforte
Copy link

Thymeleaf allows using files from src folder during development.
However live reload does not have a file system watcher for "additional paths" to auto reload based on those templates

Just as there is there is spring.devtools.restart.additional-paths,

request new property spring.devtools.livereload.additional-paths

this should work in support of thymeleaf.prefix

logging:
  config: classpath:log4j2-local.xml
spring:
  devtools:
    livereload:
      enabled: 'true'
      additional-paths:
        - file:src/main/resources/static/
        - file:src/main/resources/templates/
  thymeleaf:
    cache: 'false'
    prefix: file:src/main/resources/templates/
    check-template-location: 'true'

  web:
    resources:
      static-locations:
        - file:src/main/resources/static/
        - classpath:/static/
      cache:
        period: 0
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Apr 13, 2024
@wilkinsona wilkinsona changed the title RFC: new property "spring.devtools.livereload.additional-paths" Add a property for configuring additional livereload paths Apr 13, 2024
@mhalbritter
Copy link
Contributor

I think this is already possible, but it's somewhat non-intuitive:

Add the additional paths to spring.devtools.restart.additional-paths but then exclude them from restarting the application through spring.devtools.restart.additional-exclude.

This should set the filewatcher to watch for changes, triggering the livereload, but don't restart the app as the location has been excluded from restart.

But I agree that there should be a property for that.

@mhalbritter mhalbritter added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Apr 17, 2024
@mhalbritter mhalbritter added this to the 3.x milestone Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

3 participants