@sveltejs/adapter-vercel 1.0.4 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +3 -75
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -2,83 +2,11 @@
2
2
 
3
3
  A SvelteKit adapter that creates a Vercel app.
4
4
 
5
- If you're using [adapter-auto](../adapter-auto), you don't need to install this unless you need to specify Vercel-specific options, since it's already included.
5
+ If you're using [adapter-auto](https://kit.svelte.dev/docs/adapter-auto), you don't need to install this unless you need to specify Vercel-specific options, since it's already included.
6
6
 
7
- ## Usage
7
+ ## Docs
8
8
 
9
- Add `"@sveltejs/adapter-vercel": "next"` to the `devDependencies` in your `package.json` and run `npm install`.
10
-
11
- Then in your `svelte.config.js`:
12
-
13
- ```js
14
- import vercel from '@sveltejs/adapter-vercel';
15
-
16
- export default {
17
- kit: {
18
- // default options are shown
19
- adapter: vercel({
20
- // if true, will deploy the app using edge functions
21
- // (https://vercel.com/docs/concepts/functions/edge-functions)
22
- // rather than serverless functions
23
- edge: false,
24
-
25
- // an array of dependencies that esbuild should treat
26
- // as external when bundling functions
27
- external: [],
28
-
29
- // if true, will split your app into multiple functions
30
- // instead of creating a single one for the entire app
31
- split: false
32
- })
33
- }
34
- };
35
- ```
36
-
37
- ## Environment Variables
38
-
39
- Vercel makes a set of [deployment-specific environment variables](https://vercel.com/docs/concepts/projects/environment-variables#system-environment-variables) available. Like other environment variables, these are accessible from `$env/static/private` and `$env/dynamic/private` (sometimes — more on that later), and inaccessible from their public counterparts. To access one of these variables from the client:
40
-
41
- ```js
42
- // +layout.server.js
43
- import { VERCEL_COMMIT_REF } from '$env/static/private';
44
-
45
- /** @type {import('./$types').LayoutServerLoad} */
46
- export function load() {
47
- return {
48
- deploymentGitBranch: VERCEL_COMMIT_REF
49
- };
50
- }
51
- ```
52
-
53
- ```svelte
54
- <!-- +layout.svelte -->
55
- <script>
56
- /** @type {import('./$types').LayoutServerData} */
57
- export let data;
58
- </script>
59
-
60
- <p>This staging environment was deployed from {data.deploymentGitBranch}.</p>
61
- ```
62
-
63
- Since all of these variables are unchanged between build time and run time when building on Vercel, we recommend using `$env/static/private` — which will statically replace the variables, enabling optimisations like dead code elimination — rather than `$env/dynamic/private`. If you're deploying with `edge: true` you _must_ use `$env/static/private`, as `$env/dynamic/private` and `$env/dynamic/public` are not currently populated in edge functions on Vercel.
64
-
65
- ## Notes
66
-
67
- ### Vercel functions
68
-
69
- Vercel functions contained in the `/api` directory at the project's root will _not_ be included in the deployment — these should be implemented as [server endpoints](https://kit.svelte.dev/docs/routing#server) in your SvelteKit app.
70
-
71
- ### Node version
72
-
73
- Projects created before a certain date will default to using Node 14, while SvelteKit requires Node 16 or later. You can change that in your project settings:
74
-
75
- ![Vercel project settings](settings.png)
76
-
77
- ## Troubleshooting
78
-
79
- ### Accessing the file system
80
-
81
- You can't access the file system through methods like `fs.readFileSync` in Serverless/Edge environments. If you need to access files that way, do that during building the app through [prerendering](https://kit.svelte.dev/docs/page-options#prerender). If you have a blog for example and don't want to manage your content through a CMS, then you need to prerender the content (or prerender the endpoint from which you get it) and redeploy your blog everytime you add new content.
9
+ [Docs](https://kit.svelte.dev/docs/adapter-cloudflare)
82
10
 
83
11
  ## Changelog
84
12
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sveltejs/adapter-vercel",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/sveltejs/kit",
@@ -29,7 +29,7 @@
29
29
  "devDependencies": {
30
30
  "@types/node": "^16.18.6",
31
31
  "typescript": "^4.9.4",
32
- "@sveltejs/kit": "^1.1.1"
32
+ "@sveltejs/kit": "^1.1.3"
33
33
  },
34
34
  "peerDependencies": {
35
35
  "@sveltejs/kit": "^1.0.0"