Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ If you wish to build and publish an add-on or extension in [Vaadin Directory](ht
* TestView.java: A View class that let's you test the component you are building. This and other classes in the test folder will not be packaged during the build. You can add more test view classes in this package.
* assembly/: this folder includes configuration for packaging the project into a JAR so that it works well with other Vaadin projects and the Vaadin Directory. There is usually no need to modify these files, unless you need to add JAR manifest entries.

If you are using static resources such as images, JS (e.g. templates) and CSS files the correct location for them is under the `/src/main/resources/META-INF/resources/frontend` directory and is described here [Resource Cheat Sheet](https://vaadin.com/docs/v14/flow/importing-dependencies/tutorial-ways-of-importing.html#resource-cheat-sheet)in more details.
Stylesheets loaded with `@StyleSheet` and static resources such as images go under the `/src/main/resources/META-INF/resources` directory. JS modules (e.g. templates), and CSS files that should be included in the frontend bundle and loaded with `@CssImport`, go under the `/src/main/resources/META-INF/frontend` directory. See the [Resource Cheat Sheet](https://vaadin.com/docs/latest/flow/advanced/loading-resources#resource-cheat-sheet) for more details.

### Deployment

Expand Down
9 changes: 7 additions & 2 deletions src/main/frontend/README
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
In add-on projects, you should NOT put anything to this directory. Vaadin
tooling might still autogenerate somethign here, but just ignore this.
tooling might still autogenerate something here, but just ignore this.

E.g. Client side resources that should be available for addon users should go to:
Frontend bundle sources (JS modules, and CSS loaded with @CssImport) that
should be available for add-on users should go to:
src/main/resources/META-INF/frontend

Stylesheets loaded with @StyleSheet, and static resources such as images,
should go to:
src/main/resources/META-INF/resources

13 changes: 13 additions & 0 deletions src/main/resources/META-INF/frontend/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Place the add-on's frontend bundle sources in this directory. They are
packaged into the JAR and used as input when the consuming application
builds its frontend bundle. This is the place for JS modules referenced
with @JsModule, and for CSS files that should be included in the bundle
and loaded with @CssImport.

Use the ./ prefix when referencing the files, e.g.
@JsModule("./my-addon/my-module.js") for
src/main/resources/META-INF/frontend/my-addon/my-module.js

CSS is typically not bundled: place stylesheets in
src/main/resources/META-INF/resources and load them with @StyleSheet.
Static resources, such as images, also go there.