Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Make /client directory configurable #1345

Open
bbuhler opened this issue Jul 29, 2020 · 2 comments
Open

Make /client directory configurable #1345

bbuhler opened this issue Jul 29, 2020 · 2 comments
Assignees

Comments

@bbuhler
Copy link

bbuhler commented Jul 29, 2020

Is your feature request related to a problem? Please describe.
Yes. I've sapper running behind a proxy on domain root path. The path "/client" is been proxy passed to a different application. Since the generated client JS and CSS files are served from this path they can not be reached.

Describe the solution you'd like
A CLI argument or an option in config.client.output() rollup config to define an alternative path to serve generated client files from.

Describe alternatives you've considered
I have considered writing a script which renames the output folder and alters build.json or server.js by replacing all occurrences.

How important is this feature to you?
It is currently blocking me, so I consider to writing the script as workaround until there is a better solution.

If there is an alternative solution to my problem that I have not thought of, I am happy to hear about.

@benmccann
Copy link
Member

This happens in middleware:

We'd need to first figure out how to handle configuration in Sapper: #1216

@antony
Copy link
Member

antony commented Aug 14, 2020

I've just stumbled across this and I am totally in favour. The reason being is that it fixes this long-standing issue:

#389

If we were able to specify the asset serving dir we could point an instances assets at it's real url (in the instance of red-green deployment where you deploy to an alternative url and then switch over the DNS) - see the Vercel solution here: https://twitter.com/PierB/status/1294311963363889152

And also would allow people to hash the client directory after builds, meaning that in the instance of a non red-green deployment, open instances of the app would continue to point to their own assets rather than the latest deployment.

I will see if I can come up with a PR for this.

@antony antony self-assigned this Aug 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants