How can I externalise my stylesheets and any javascript code generated by vaadin

I’m developing a spring boot Vaadin application (version - 24.6.0) where I want externalized my stylesheets in order to make it more secure for restricted production deployments. Currently, I have:

  1. Added custom styles in custom-dashboard-view.css
  2. Mapped it to style.css through @import
  3. Specified a custom theme “dashboard-app” in Application.java
  4. Applied custom classes in CustomDashboardView.java
  5. Built the app through maven vaadin:build-frontend goal

The styles are working correctly, but I can still see all the CSS class content in the html code through browser’s developer tools, even after externalizing the stylesheets.

#vaadin #java #spring-boot

You might wanna take a look here: How to externalise stylesheets and javascript code generated by vaadin?