-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
feat: Vite environment API #14008
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
base: main
Are you sure you want to change the base?
feat: Vite environment API #14008
Conversation
|
|
You probably need to bump the peer dep version on Vite |
Thanks! I missed that. Bumped it to 7 because I think 6 is missing some Environment API behaviour around multiple plugins building the app |
closes #13692
closes #1712
part of #3535
closes #13739
closes #13357
closes #12637
w.i.p and still has a lot of problems to solve. Needed to open this PR to test installing this from pkg.pr.new since linking locally with pnpm symlinks to the local kit repo. Then, when we try importing kit code from inside an environment, it results in a path which doesn't exist such as
/packages/kit/...
. Instead, it should probably import fromnode_modules/@sveltejs/kit/...
.This PR adopts the Vite Environment API in
kit
and changesadapter-cloudflare
to use a similar approach to Remix where the user can specify their ownworker.js
file. Otherwise, we can generate the wrangler config and worker for them. This approach integrates well withvite-plugin-cloudflare
and provides users with direct access to the worker script, allowing them to export Durable Objects and add additional handlers.Thanks to @jamesopstad for #12637 and writing up the Google Doc explaining the Remix and vite-plugin-cloudflare integration. Resources include:
TODO
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm test
and lint the project withpnpm lint
andpnpm check
Changesets
pnpm changeset
and following the prompts. Changesets that add features should beminor
and those that fix bugs should bepatch
. Please prefix changeset messages withfeat:
,fix:
, orchore:
.Edits