qwik
qwik copied to clipboard
[✨] provide a way to customize the build output to subpath
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...?
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
- what is the recommended way to sharing domain?
- if I'd like to open a PR, how should I add these
subpathsettings? - related: https://github.com/BuilderIO/qwik/issues/2462#issuecomment-1490291666
@revintec you need to set base to e.g. '/sub/' in vite, not in qwik
@revintec did you try the suggested solution?
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 🙏