-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose the Vite dev server #3869
Comments
Related #2921 |
Here's the PR for reference: #2663. But we didn't want to expose the dev server or component loading unless absolutely necessary I'm not entirely sure you'd need it for what you're attempting. The kit/packages/kit/src/core/dev/plugin.js Line 177 in 2fefa5e
As a result, anything loaded in the hooks should generally be transitively loaded by Vite's |
@phiberber also said he was able to grab it from a Vite plugin as another solution:
|
I would like to run the dev server in-process; I don't need access to the internals, an opaque function that takes (req, res, next) or Web Fetch versions would be fine. I guess this actually also asks for a programmatic interface to SvelteKit. |
This is now implemented in the Telefunc vite plugin.
I think that you can use of Svelte Kit Endpoints to that, if not maybe an express-like middleware system written with Svelte Kit hooks fullfills your needs, not sure how recommended is it though. |
If this relies on the dev server, how does it work in prod? |
Going to close this now that we just use a regular Vite config |
Describe the problem
Telefunc cannot be used with SvelteKit because Telefunc needs a reference to the Vite dev server which SvelteKit creates at:
kit/packages/kit/src/core/dev/index.js
Line 92 in cf5d4aa
(Telefunc needs the Vite dev server to be able to run
vite.ssrLoadModule()
in order toimport.meta.glob('**/*.telefunc.*')
.)Describe the proposed solution
Expose the vite dev server.
For reference this is how Telefunc integrates with vite-plugin-ssr: https://github.com/vikejs/telefunc/blob/ff196287342b4ea3addbc0e0a559eef680f73796/examples/vite-plugin-ssr/server/index.js
Note how the Vite dev server is set to
telefuncConfig.viteDevServer
here: https://github.com/vikejs/telefunc/blob/ff196287342b4ea3addbc0e0a559eef680f73796/examples/vite-plugin-ssr/server/index.js#L23@benmccann mentioned that there is PR to make the Vite dev server accessible, any chance to get it merged?
CC @phiberber who is working on a SvelteKit + Telefunc example.
Alternatives considered
No response
Importance
i cannot use SvelteKit without it
Additional Information
No response
The text was updated successfully, but these errors were encountered: