flow
flow copied to clipboard
Jetty hot reload for theme folder in separate project during development
Description of the bug
For shared styles a suggested solution is packaging themes in a separate jar. (We already did that because we use a framework project containing helper classes and styles shared among several applications). Using CssImport jetty, hot reload (Eclipse with maven run configuration for starting the jetty with enabled workspace resolution) worked. Changes in css and java were visible in the running application.
Switching to the Theme annotation using themefolder import, hot reload for css changes works only if the theme folder is in the application project itself. If the theme is packaged in a separate project, the application fails to start, because (if both projects are open in the workspace and workspace resolution is activated for the maven run configuration starting the jetty) the theme folder is not picked up. If the "theme project" is closed or workspace resolution is deactivated, the application starts, because the theme files are copied to target/frontend/themes.
Expected behavior
During development in Eclipse, using a run configuration with enabled workspace resolution and both projects being in the workspace
- the application starts and finds the external theme folder
- changes in the "external" css are reflected in the running application
Minimal reproducible example
https://github.com/nittka/devday-demo-flow/commits/themefolder
It is a fork from Tatu's demo application, reduced to one view with a style file packaged in a separate jar.
Versions
- Vaadin / Flow version: 14.8.14
- Java version: 8
- OS version: Linux
- Browser version (if applicable):
- Application Server (if applicable): Jetty (Development)
- IDE (if applicable): Eclipse