HotDeploy of css from local machine using the @StyleSheet annotation



I am using scss and success to get hot deploy working with relevant plugin using the @CssImport

Now, doing same with @StyleSheet is a bit problematic because files in this case must be inside the classpath.

So I thought why not simply look on file system (just for developing time) e.g:


Or any other place in the system

in console: Error loading file:///C:/projects/_V14/PL/US/shell/src/main/resources/META-INF/resources/frontend/styles/Alis/styles.css

EC @ client-D58DD39284EE8…487AA2.cache.js:205

Html looks great and valid, but fail loading the file

<link rel="stylesheet" type="text/css" href="file:///C:/projects/_V14/PL/US/shell/src/main/resources/META-INF/resources/frontend/styles/Alis/styles.css">

Looks like something block it from Vaadin side, despite html is legal and work well in stand alone html page.

Any idea?

The browser will not load files from the local file system for security reasons for a page that is loaded over the network.

What you can look into instead is to configure your web server to serve static files from some specific URL straight from the file system instead of only looking inside the deployed package.


Just did the same while you respond

Installed apache web server, and the scss plugin watcher is now build the css to the new server path

Now, when develop css just use @StyleSheet(“http://localhost:90/styles.css”)

Not so nice, but overcome the blocker pointing on file system