Repository navigation
fix: join servlet context path to Vite base path in dev mode - #12771
Conversation
33e9889 to
2de1d1f
Compare
| }, | ||
| { | ||
| name: 'inject-entrypoint-script', | ||
| name: 'force-remove-spa-middleware', |
There was a problem hiding this comment.
note: Following the separation of concerns principle, I decided to extract this workaround into a separate plugin.
| return [ | ||
| { | ||
| tag: 'script', | ||
| attrs: { type: 'module', src: `${basePath}generated/vite-devmode.ts` }, |
There was a problem hiding this comment.
note: I decided in favor of the script path being based on the server base path rather than a hard-coded /VAADIN/. It might theoretically be useful in the case the user wants to configure the base property in a custom way.
| return { | ||
| root: 'frontend', | ||
| base: basePath, | ||
| base: '', |
There was a problem hiding this comment.
note: The --base argument, which the dev server passes to .bin/vite in dev mode from now on, will take precedence over the config's base property.
54496f4 to
97d7618
Compare
2b50ca1 to
7551549
Compare
|
Kudos, SonarCloud Quality Gate passed!
|
|
This ticket/PR has been released with platform 23.0.0.alpha4 and is also targeting the upcoming stable 23.0.0 version. |








Description
When the user runs a Flow application with a servlet context path specified, Vite server's base path, as well as subsequent requests to the Vite server, should start with that context path. The PR takes this approach to address the problem of the app frontend resources not loading correctly when using Vite in combination with a servlet context path. Note, the problem is only specific to the dev mode.
Fixes #12388
Type of change
Checklist