You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Afilepathtoacustomentrypointfortheserver. Passedto`vite.build.rollupOptions.input`. See [theRollupdocs](https://rollupjs.org/guide/en/#input) for more info.
Copy file name to clipboardExpand all lines: packages/adapter-netlify/README.md
-32
Original file line number
Diff line number
Diff line change
@@ -66,38 +66,6 @@ During compilation a required "catch all" redirect rule is automatically appende
66
66
node_bundler = "esbuild"
67
67
```
68
68
69
-
## Advanced Configuration
70
-
71
-
### esbuild
72
-
73
-
As an escape hatch, you may optionally specify a function which will receive the final esbuild options generated by this adapter and returns a modified esbuild configuration. The result of this function will be passed as-is to esbuild. The function can be async.
74
-
75
-
For example, you may wish to add a plugin:
76
-
77
-
```js
78
-
adapterNetlify({
79
-
esbuild(defaultOptions) {
80
-
return {
81
-
...defaultOptions,
82
-
plugins: []
83
-
};
84
-
}
85
-
});
86
-
```
87
-
88
-
The default options for this version are as follows:
89
-
90
-
```js
91
-
{
92
-
entryPoints: ['.svelte-kit/netlify/entry.js'],
93
-
// This is Netlify's internal functions directory, not the one for user functions.
[The Changelog for this package is available on GitHub](https://github.com./sveltejs/kit/blob/master/packages/adapter-netlify/CHANGELOG.md).
Copy file name to clipboardExpand all lines: packages/adapter-node/README.md
+7-50
Original file line number
Diff line number
Diff line change
@@ -15,21 +15,13 @@ export default {
15
15
adapter:adapter({
16
16
// default options are shown
17
17
out:'build',
18
-
precompress:false,
19
-
env: {
20
-
host:'HOST',
21
-
port:'PORT'
22
-
}
18
+
precompress:false
23
19
})
24
20
}
25
21
};
26
22
```
27
23
28
-
## Options
29
-
30
-
### entryPoint
31
-
32
-
The server entry point. Allows you to provide a [custom server implementation](#middleware). Defaults to the provided reference server.
24
+
## Build Options
33
25
34
26
### out
35
27
@@ -39,21 +31,23 @@ The directory to build the server to. It defaults to `build` — i.e. `node buil
39
31
40
32
Enables precompressing using gzip and brotli for assets and prerendered pages. It defaults to `false`.
41
33
42
-
### env
34
+
## Runtime Options
35
+
36
+
### Environment variables
43
37
44
38
By default, the server will accept connections on `0.0.0.0` using port 3000. These can be customised with the `PORT` and `HOST` environment variables:
45
39
46
40
```
47
41
HOST=127.0.0.1 PORT=4000 node build
48
42
```
49
43
50
-
You can specify different environment variables if necessary using the `env` option.
44
+
You can also specify `SOCKET_PATH` if you'd like to use a Unix domain socket or Windows named pipe.
51
45
52
46
## Middleware
53
47
54
48
The adapter exports a middleware `(req, res, next) => {}` that's compatible with [Express](https://github.com./expressjs/expressjs.com) / [Connect](https://github.com./senchalabs/connect) / [Polka](https://github.com./lukeed/polka). Additionally, it also exports a reference server implementation using this middleware with a plain Node HTTP server.
55
49
56
-
But you can use your favorite server framework to combine it with other middleware and server logic. You can import `kitMiddleware`, your ready-to-use SvelteKit middleware from the `build` directory. You can use [the `entryPoint` option](#entryPoint) to bundle your custom server entry point.
50
+
But you can use your favorite server framework to combine it with other middleware and server logic. You can import `kitMiddleware`, your ready-to-use SvelteKit middleware from the `build` directory. You can use [the `serverEntryPoint` option](https://kit.svelte.dev/docs#configuration-serverentrypoint) to bundle your custom server entry point.
57
51
58
52
```js
59
53
// src/server.js
@@ -83,43 +77,6 @@ app.listen(3000);
83
77
84
78
For using middleware in dev mode, [see the FAQ](https://kit.svelte.dev/faq#how-do-i-use-x-with-sveltekit-how-do-i-use-middleware).
85
79
86
-
## Advanced Configuration
87
-
88
-
### esbuild
89
-
90
-
As an escape hatch, you may optionally specify a function which will receive the final esbuild options generated by this adapter and returns a modified esbuild configuration. The result of this function will be passed as-is to esbuild. The function can be async.
91
-
92
-
For example, you may wish to add a plugin:
93
-
94
-
```js
95
-
adapterNode({
96
-
esbuild(defaultOptions) {
97
-
return {
98
-
...defaultOptions,
99
-
plugins: []
100
-
};
101
-
}
102
-
});
103
-
```
104
-
105
-
The default options for this version are as follows:
106
-
107
-
```js
108
-
{
109
-
entryPoints: ['.svelte-kit/node/index.js'],
110
-
outfile:'pathTo/index.js',
111
-
bundle:true,
112
-
external: allProductionDependencies, // from package.json
113
-
format:'esm',
114
-
platform:'node',
115
-
target:'node14',
116
-
inject: ['pathTo/shims.js'],
117
-
define: {
118
-
esbuild_app_dir:`"${config.kit.appDir}"`
119
-
}
120
-
}
121
-
```
122
-
123
80
## Deploying
124
81
125
82
You will need the output directory (`build` by default), the project's `package.json`, and the production dependencies in `node_modules` to run the application. Production dependencies can be generated with `npm ci --prod`, you can also skip this step if your app doesn't have any dependencies. You can then start your app with
0 commit comments