Skip to content

Expose the Vite dev server #3869

Closed
Closed
@brillout

Description

@brillout

Describe the problem

Telefunc cannot be used with SvelteKit because Telefunc needs a reference to the Vite dev server which SvelteKit creates at:

const server = await vite.createServer(merged_config);
.

(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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions