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).
You can also specify `SOCKET_PATH` if you'd like to use a Unix domain socket or Windows named pipe.
62
45
63
46
## Middleware
64
47
65
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.
66
49
67
-
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.
68
51
69
52
```js
70
53
// src/server.js
@@ -94,43 +77,6 @@ app.listen(3000);
94
77
95
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).
96
79
97
-
## Advanced Configuration
98
-
99
-
### esbuild
100
-
101
-
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.
102
-
103
-
For example, you may wish to add a plugin:
104
-
105
-
```js
106
-
adapterNode({
107
-
esbuild(defaultOptions) {
108
-
return {
109
-
...defaultOptions,
110
-
plugins: []
111
-
};
112
-
}
113
-
});
114
-
```
115
-
116
-
The default options for this version are as follows:
117
-
118
-
```js
119
-
{
120
-
entryPoints: ['.svelte-kit/node/index.js'],
121
-
outfile:'pathTo/index.js',
122
-
bundle:true,
123
-
external: allProductionDependencies, // from package.json
124
-
format:'esm',
125
-
platform:'node',
126
-
target:'node14',
127
-
inject: ['pathTo/shims.js'],
128
-
define: {
129
-
esbuild_app_dir:`"${config.kit.appDir}"`
130
-
}
131
-
}
132
-
```
133
-
134
80
## Deploying
135
81
136
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