Dynamic basepath
See original GitHub issueMoving this here:
One blocking issue I’ve run into with the current Sapper is that I can’t rewrite urls from various sites that we want to host a “whitelabel” version of our app on, because the basepath has to be set in stone at build time:
https://example.com/some-path/ <-- does not work https://subdomain.example.com/ <-- works fine
rather than host a different app for people who want to mount it under a subpath, ideally basepath could be a runtime concern. However I don’t know if this is feasible, but it’s worth considering.
Cool. For me it is to support ipfs website both when served through an ENS domain or through a gateway with ipfs/ base path for example, both url point to the same exact content : https://ipfs.io/ipfs/bafybeieeuq3av6jdys2q2zwhfv5hutcqejczr46wzjikd5vulfaxfi72r4/ https://jolly-roger.eth.link/ for the hash version, I have to compute at runtime the basepath since it is not possible to know the hash of an ipfs website at build time
https://ptb.discord.com/channels/457912077277855764/750388563354583071/771786495152357386
paths.base
is baked into the app at build time. Changing this would likely need to be done in Vite: https://github.com/vitejs/vite/issues/2009
Issue Analytics
- State:
- Created 2 years ago
- Reactions:20
- Comments:40 (15 by maintainers)
Top GitHub Comments
Quite disappointed to see this issue get moved to post-1.0 😔
Yeah - this is super critical from my perspective, we have an ever growing range of people who use our main site with branding, and they hate subdomains because it’s arguably not as good for SEO. Sapper doesn’t support using a sub-path as the root without a totally separate build and deployment.