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] Add reload on CSS and JS file changes #401

Closed
2 tasks done
pydanny opened this issue Sep 5, 2024 · 2 comments
Closed
2 tasks done

[FEATURE] Add reload on CSS and JS file changes #401

pydanny opened this issue Sep 5, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@pydanny
Copy link
Collaborator

pydanny commented Sep 5, 2024

Is your feature request related to a problem? Please describe.

I would be nice if FastHTMLLiveReload supported CSS and JS files. See https://discord.com/channels/689892369998676007/1247700012952191049/1281138518382350422

Describe the solution you'd like

Implement this uvicorn main:app --reload-include="*.css" --reload-include="*.js" but in the live_reload.py module and callable from fast_app()

Example code
Provide an example of how you imagine the feature working:

app, rt = fast_app(reload_css=True, reload_js=True)

Problem solved

Makes it easier to work with CSS and JS files. There might still be issues with browser caching.

Confirmation

Please confirm the following:

  • I have checked the existing issues and pull requests to ensure this feature hasn't been requested before.
  • I have read the project's documentation to ensure this feature doesn't already exist.
@pydanny pydanny added the enhancement New feature or request label Sep 5, 2024
@RensDimmendaal
Copy link

This may help you @pydanny

Instead of running serve() run serve(reload_includes=["static/*"])

This solved the issue for me as now the app would reload if I'd change some files in my static folder.

@pydanny
Copy link
Collaborator Author

pydanny commented Sep 9, 2024

Thanks!

In a total facepalm moment I admit to adding that feature to FastHTML #291 😅

@pydanny pydanny closed this as completed Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants