vaadin/addon-template

Example: Adding custom JavaScript

Opened this issue · 2 comments

Could you please add a custom js file to this project?
It would help to understand where to place frontend resources in this type of project.

I request this feature as I just ran into the issue that resources placed at src\main\resources\META-INF\resources\frontend are not available when running jetty from inside of the project.

JavaScript files for add-ons should be in src/main/resources/META-INF/frontend/ or src/main/resources/META-INF/resources/frontend and can then be referenced as @JsModule("./TimeSelector.js").

The folder src/main/resources/META-INF/resources/frontend should be the correct directory if executing the add on as an application as that location should be copied as local resources.

Perhaps when running jetty you didn't execute prepare-frontend goal or the add-on is not found on the classpath for copying of the file contents when executing jetty.

The resource-cheat-sheet named in the README should be correct on the placement of files.

This should be added indeed, or even just the right directory with readme file. Also the current ./frontend directory with its autogenerated content should be removed. It just causes confusion as one really should not use that at all in an add-on project.