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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] use the Vite server options in dev mode #2232

Merged
merged 3 commits into from
Sep 16, 2021
Merged

Conversation

benmccann
Copy link
Member

@benmccann benmccann commented Aug 17, 2021

What's changing

This PR adds the SvelteKit middleware after the Vite-provided middlewares using a Vite plugin

Why

People get confused by the presence of Vite server options that mostly don't do anything today.

We also have to create a lot of duplicate functionality. With this change we possibly could delete everything that's in the server folder today in a follow-up PR.

Other considerations

Right now, using Node middleware in dev and prod are very different from one another. We could also consider a separate change that would expose the middleware creation function to allow the user to utilize the Kit middleware in dev mode with their own server. This change would make that just ever so-slightly harder because that function would need to set middlewareMode: true and this PR is removing that default setting. (Another potential solution to that problem might be to see if we could make adapters into Vite plugins, but now we're getting way off topic 馃槅 )

@changeset-bot
Copy link

changeset-bot bot commented Aug 17, 2021

馃 Changeset detected

Latest commit: 9899659

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@sveltejs/kit Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@benmccann benmccann linked an issue Aug 21, 2021 that may be closed by this pull request
@benmccann benmccann force-pushed the vite-server branch 3 times, most recently from 79ccb38 to d4065b3 Compare September 13, 2021 03:30
@benmccann benmccann force-pushed the vite-server branch 2 times, most recently from 1510d2c to 4abf326 Compare September 13, 2021 04:20
@benmccann benmccann marked this pull request as ready for review September 13, 2021 04:30
@benmccann benmccann changed the title Use the Vite server rather than creating our own [feat] use the Vite server options in dev mode Sep 13, 2021
@benmccann benmccann merged commit b0ddbb3 into master Sep 16, 2021
@benmccann benmccann deleted the vite-server branch September 16, 2021 16:48
sidharthv96 added a commit to sidharthv96/kit that referenced this pull request Sep 19, 2021
* 'master' of https://github.com/sveltejs/kit: (322 commits)
  Version Packages (next) (sveltejs#2438)
  [fix] revert sveltejs#2354 and fix double character decoding a different way (sveltejs#2435)
  chore: update dependencies (sveltejs#2447)
  [docs] add link to envPrefix option in env var FAQ (sveltejs#2445)
  Fix invalid changeset. Thanks GitHub bot :-p
  [feat] use the Vite server options in dev mode (sveltejs#2232)
  [fix] provide valid value for `letter-spacing` CSS property in template (sveltejs#2437)
  [docs] fix typo (sveltejs#2443)
  [fix] add svelte field when packaging (sveltejs#2431)
  Version Packages (next) (sveltejs#2428)
  [chore] update lockfile
  [fix] update to TS 4.4.3 (sveltejs#2432)
  [chore] add links to repository and homepage to package.json (sveltejs#2425)
  docs: use fragment for prefetching link (sveltejs#2429)
  [fix] encodeURI during prerender (sveltejs#2427)
  Version Packages (next) (sveltejs#2420)
  revert change to versioning during release workflow
  chore: update vite-plugin-svelte (sveltejs#2423)
  [chore] expose Body generic to hook functions (sveltejs#2413)
  [feat] adapter-node entryPoint option (sveltejs#2414)
  ...
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.

CLI ignores Vite server config
1 participant