Expose the Vite dev server
See original GitHub issueDescribe the problem
Telefunc cannot be used with SvelteKit because Telefunc needs a reference to the Vite dev server which SvelteKit creates at:https://github.com/sveltejs/kit/blob/cf5d4aa54c3824a93967abe8508931854cd30524/packages/kit/src/core/dev/index.js#L92.
(Telefunc needs the Vite dev server to be able to run vite.ssrLoadModule()
in order to import.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
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:7 (5 by maintainers)
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.
Going to close this now that we just use a regular Vite config