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
30atm opened this issue Apr 13, 2024 · 7 comments
Open

Add a property for configuring additional livereload paths #40342

30atm opened this issue Apr 13, 2024 · 7 comments
Assignees
Labels
type: enhancement A general enhancement
Milestone

Comments

@30atm
Copy link

30atm commented Apr 13, 2024

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
@itsAkshayDubey
Copy link
Contributor

Hi @mhalbritter ,

I would like to work on this enhancement, could you please assign me this issue so that I can submit my PR in favour of this issue.

Thanks,
Akshay

@philwebb
Copy link
Member

All yours @itsAkshayDubey

@30atm
Copy link
Author

30atm commented May 21, 2024

I used a work-around and achieved this behavior

see LiveReloadConfig.java in this repo https://github.com/ibhatech/world-facts/tree/dev

@itsAkshayDubey
Copy link
Contributor

Unable to access this repo. @metaforte

@30atm
Copy link
Author

30atm commented May 21, 2024

made it public now

@itsAkshayDubey
Copy link
Contributor

Hi @philwebb ,

Kindly have a look at PR #41566

Thanks,
Akshay

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

5 participants