Repository navigation
feat: Serve theme files separately from dev bundle - #15518
Conversation
| // First, look for the theme assets in the {project.root}/frontend/ | ||
| // themes/my-theme folder | ||
| File frontendFolder = new File(projectFolder, FrontendUtils.FRONTEND); | ||
| File assetInFrontendThemes = new File(frontendFolder, assetPath); |
There was a problem hiding this comment.
PATH_TRAVERSAL_IN: This API (java/io/File.(Ljava/io/File;Ljava/lang/String;)V) reads a file whose location might be specified by user input
ℹ️ Learn about @sonatype-lift commands
You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.
| Command | Usage |
|---|---|
@sonatype-lift ignore |
Leave out the above finding from this PR |
@sonatype-lift ignoreall |
Leave out all the existing findings from this PR |
@sonatype-lift exclude <file|issue|path|tool> |
Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file |
Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.
Was this a good recommendation?
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]
…eparately # Conflicts: # flow-server/src/main/java/com/vaadin/flow/server/communication/IndexHtmlRequestHandler.java
e86c05c to
7412d6b
Compare
…eparately # Conflicts: # flow-server/src/test/java/com/vaadin/flow/server/communication/IndexHtmlRequestHandlerTest.java
d279f55 to
760a6d6
Compare
| }, | ||
| build: { | ||
| outDir: buildOutputFolder, | ||
| emptyOutDir: devBundle, |
There was a problem hiding this comment.
I've commented it when was developing the feature, because if it's set to true the assets copied from node_modules to the dev-bundle was removed immediately. So it was copied and removed. I'll double check it.
There was a problem hiding this comment.
Seems like themePlugin({devMode}), which copies the assets to the dev-bundle is executed before the Vite empties the bundle output folder. An easiest way to fix it is probably to copy assets into dev-bundle/assets, not inside the bundle output dir dev-bundle/webapp/assets.
There was a problem hiding this comment.
Fixed. Thanks for noticing this 👍
|
Kudos, SonarCloud Quality Gate passed!
|
In the Express Build mode: - serves theme files (styles.css and other project's stylesheets imported to styles.css) separately from the dev-bundle directly from custom theme (frontend/themes/my-theme) folder - copies the assets referenced in theme.json to the dev bundle within bundle re-compilation serves assets/styles from dev-bundle, if can't find them in the frontend folder - Does not yet take into account serving styles from default bundle (from classpath). Related-to #15478
|
This ticket/PR has been released with Vaadin 24.0.0.alpha7 and is also targeting the upcoming stable 24.0.0 version. |








In the Express Build mode:
styles.cssand other project's stylesheets imported tostyles.css) separately from thedev-bundledirectly from custom theme (frontend/themes/my-theme) foldertheme.jsonto the dev bundle within bundle re-compilationdev-bundle, if can't find them in thefrontendfolderDoes not yet take into account serving styles from default bundle (from classpath).
Related-to #15478