Skip to content
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

Using vite plugin node for svelte kit #43

Closed
wants to merge 1 commit into from

Conversation

DarwinSenior
Copy link

Hi there,
I want to make this PR so that it is possible to use this plugin for @svelte/kit.

This pr in current form will create breakage to #25, but I would still like to introduce it so that it will play nicely with sveltekit.
Currently there is extensive discussion that the node adapter for the svelte kit is limited especially during the development.

Essentially, I want to pass next parameter to adapter function for the following usage:

async (app, req, res, next, server) => {
  // app here is fastify for example
  app.setDefaultRoute(() => next())
  await app.ready()
  app.routing(req, res)
}

The reason why it is necessary is that the sveltekit also mess with middleware. So that it remove the assumption that the vite-plugin-node is the end of all middleware.

I do hope you can consider this change as it greatly helps a lot of the discussion of sveltekit. For example sveltejs/kit#4654

@axe-me
Copy link
Owner

axe-me commented May 5, 2022

hi @DarwinSenior, thank you for your contribution. I'm planning to do some issue cleanup and bug fix this weekend.

Not sure if you can wait 2~3 days for me. This PR indeed will introduce some braking changes to this plugin. I may need to bump the major version of this plugin after merging this.

@DarwinSenior
Copy link
Author

I see that the new ways to include next. Thanks. I will close this issue now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants