You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enable embedded deployments via reverse proxies. Without a relative base path, clients potentially resolve wrong static assets.
Example
reverse proxy: /editor -> localhost:3001/
reverse proxy: /app -> localhost:3002/
a user requesting `/editor` without a relative base path of HTML that contains an asset like `/image.png` will resolve to `<reverse-proxy>/image.png` instead of `/editor/image.png`.
I'm guessing that /editor and /app are two distinct Vike apps. AFAICT an absolute base path works just fine in that situation: set base: '/editor' for the editor, and base: '/app' for the app.
Closing, but let's continue the discussion and I'll potentially re-open.
FYI this is a bit of a deal breaker for @bloodchen. Here is the use case: they want to build a full SSG website, zip /dist/client and tell their client to unzip that anywhere in their statically served filesystem, say /var/www/html/anywhere/hello/ and expect all the links to work because they set base: './' before building.
As I got approached with "just remove that assertion", I did an experiment. I took a trivial SSG example, set base: './' and tried to get the build passing by just removing assertions. I ended up having to remove 20+ assertions and as expected, links were broken in the output.
If we want to support this, say for SSG only, this is going to require a significant effort.
Description
Vike throws an error on a
base
config of./
that Vite explicitly allows:https://vitejs.dev/config/shared-options.html#base
Why is
./
needed?Enable embedded deployments via reverse proxies. Without a relative base path, clients potentially resolve wrong static assets.
Example
Reproduction
https://stackblitz.com/edit/vitejs-vite-eowwvq?file=vike-app%2Fvite.config.js
// vite.config.ts export default { plugins: [react(), vike()], + base: './', };
cc @NiklasBuchfink
The text was updated successfully, but these errors were encountered: