This is for @sveltejs/kit <= 1.0.0-next.525
.
https://github.com/torenware/ddev-viteserve might fit your needs better if you are not using svelte.
Note: This will not install if there is already a src/hooks.server.[jt]s
file.
You should review your src/hooks.server.[jt]s
file and either remove it or you'd have to adjust all your files manually.
This exposes the debug port of vite on the container port 9229 aswell. To use it, run
ddev viteinspect
instead of ddev yarn dev
.
.ddev/nginx_full/nginx-site.conf
to proxy requests to http://localhost:5173
and pass the adjusted origin.src/hooks.server.js
to adjust the origin to DDEV_PRIMARY_URL
on outgoing cors requests when using svelte's provided fetch
.src/hooks.server.js
to .git/info/exclude
..ddev/docker-compose.network.yaml
to add additional known hosts in the network..ddev/docker-compose.debug.yaml
to expose the vite debugging portddev config --auto --omit-containers=db,dba --nodejs-version=16
mkcert -install
ddev get mdc-git/ddev-sveltekit
ddev viteinspect
https://github.com/sveltejs/kit/issues/8026
see nginx-site.conf: proxy_set_header Origin http://node-srv;
this fixes Cross-site POST form submissions are forbidden
on internal /api
requests.
https://github.com/sveltejs/kit/issues/6608 (see hooks.server.js)
this essentially handles outgoing cors fetch requests in endpoints.
it should override the outgoing requests origin event.url
to DDEV_PRIMARY_URL
this makes it semantically consistent with the external servers Access-Control-Allow-Origin
A linux binary of jq and hjson along with a small utility script to attach vscode to containerip:9229
will be installed under .ddev/sveltekit and .ddev/commands/host which will increase the repository size to ~5MB. I need them to rewrite my vscode config. Sorry if that annoys you.