qwik icon indicating copy to clipboard operation
qwik copied to clipboard

[✨] provide a way to customize the build output to subpath

Open revintec opened this issue 2 years ago • 1 comments

Is your feature request related to a problem?

sharing a domain using subpath should be a common problem, a lot of site(esp. production ones) needs it

npm run preview in the default setting outputs to dist directory, let's say we deploy it to http://a.com, then http://a.com/service-worker.js, http://a.com/manifest.json, http://a.com/build/q-xxx.js, etc...

how to make everything under a subpath(when sharing a domain name) like http://a.com/sub/service-worker.js, http://a.com/sub/manifest.json, http://a.com/sub/build/q-xxx.js, etc...?

image

I've tried the above but it only affected js files not png(using import ...?url) files, and also, how to change subpath for service-worker.js, manifest.json, etc?

Describe the solution you'd like

add a switch(commandline and/or entry.ssr.tsx setting), that controls subpathing --subpath=abc/def -> http://a.com/abc/defservice-worker.js, http://a.com/abc/defbuild/q-xxx.js --subpath=abc/def/ -> http://a.com/abc/def/service-worker.js, http://a.com/abc/def/build/q-xxx.js

Describe alternatives you've considered

no viable alternative that I can think of, we can't just move the build folder and/or files under dist

Additional context

No response

revintec avatar Apr 13 '23 10:04 revintec

  1. what is the recommended way to sharing domain?
  2. if I'd like to open a PR, how should I add these subpath settings?
  3. related: https://github.com/BuilderIO/qwik/issues/2462#issuecomment-1490291666

revintec avatar Apr 13 '23 10:04 revintec

@revintec you need to set base to e.g. '/sub/' in vite, not in qwik

wmertens avatar Nov 25 '23 22:11 wmertens

@revintec did you try the suggested solution?

gioboa avatar Jun 14 '24 13:06 gioboa

Hello @revintec. Please provide the missing information requested above. Issues marked with STATUS-2: missing info will be automatically closed if they have no activity within 14 days. Thanks 🙏

github-actions[bot] avatar Jun 14 '24 13:06 github-actions[bot]