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
Copy file name to clipboardExpand all lines: packages/adapter-cloudflare-workers/README.md
+32-1
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ SvelteKit adapter that creates a Cloudflare Workers site using a function for dy
4
4
5
5
This is very experimental; the adapter API isn't at all fleshed out, and things will definitely change.
6
6
7
-
## Configuration
7
+
## Basic Configuration
8
8
9
9
This adapter expects to find a [wrangler.toml](https://developers.cloudflare.com/workers/platform/sites/configuration) file in the project root. It will determine where to write static assets and the worker based on the `site.bucket` and `site.entry-point` settings.
10
10
@@ -26,6 +26,37 @@ It's recommended that you add the `build` and `workers-site` folders (or whichev
26
26
27
27
More info on configuring a cloudflare worker site can be found [here](https://developers.cloudflare.com/workers/platform/sites/start-from-existing)
28
28
29
+
## Advanced Configuration
30
+
31
+
### esbuild
32
+
33
+
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.
34
+
35
+
For example, you may wish to add a plugin:
36
+
37
+
```js
38
+
adapterCfw({
39
+
esbuild(defaultOptions) {
40
+
return {
41
+
...defaultOptions,
42
+
plugins: []
43
+
};
44
+
}
45
+
});
46
+
```
47
+
48
+
The default options for this version are as follows:
[The Changelog for this package is available on GitHub](https://github.com/sveltejs/kit/blob/master/packages/adapter-cloudflare-workers/CHANGELOG.md).
Copy file name to clipboardExpand all lines: packages/adapter-netlify/README.md
+31
Original file line number
Diff line number
Diff line change
@@ -53,6 +53,37 @@ During compilation a required "catch all" redirect rule is automatically appende
53
53
2. Netlify's build bot parses your HTML files at deploy time, which means your form must be [prerendered](https://kit.svelte.dev/docs#ssr-and-javascript-prerender) as HTML. You can either add `export const prerender = true` to your `contact.svelte` to prerender just that page or set the `kit.prerender.force: true` option to prerender all pages.
54
54
3. If your Netlify form has a [custom success message](https://docs.netlify.com/forms/setup/#success-messages) like `<form netlify ... action="/success">` then ensure the corresponding `/routes/success.svelte` exists and is prerendered.
55
55
56
+
## Advanced Configuration
57
+
58
+
### esbuild
59
+
60
+
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.
61
+
62
+
For example, you may wish to add a plugin:
63
+
64
+
```js
65
+
adapterNetlify({
66
+
esbuild(defaultOptions) {
67
+
return {
68
+
...defaultOptions,
69
+
plugins: []
70
+
};
71
+
}
72
+
});
73
+
```
74
+
75
+
The default options for this version are as follows:
76
+
77
+
```js
78
+
{
79
+
entryPoints: ['.svelte-kit/netlify/entry.js'],
80
+
outfile:`pathToFunctionsFolder/render/index.js`,
81
+
bundle:true,
82
+
inject: ['pathTo/shims.js'],
83
+
platform:'node'
84
+
}
85
+
```
86
+
56
87
## Changelog
57
88
58
89
[The Changelog for this package is available on GitHub](https://github.com/sveltejs/kit/blob/master/packages/adapter-netlify/CHANGELOG.md).
You can specify different environment variables if necessary using the `env` option.
47
47
48
+
## Advanced Configuration
49
+
50
+
### esbuild
51
+
52
+
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.
53
+
54
+
For example, you may wish to add a plugin:
55
+
56
+
```js
57
+
adapterNode({
58
+
esbuild(defaultOptions) {
59
+
return {
60
+
...defaultOptions,
61
+
plugins: []
62
+
};
63
+
}
64
+
});
65
+
```
66
+
67
+
The default options for this version are as follows:
68
+
69
+
```js
70
+
{
71
+
entryPoints: ['.svelte-kit/node/index.js'],
72
+
outfile:'pathTo/index.js',
73
+
bundle:true,
74
+
external: allProductionDependencies, // from package.json
75
+
format:'esm',
76
+
platform:'node',
77
+
target:'node12',
78
+
inject: ['pathTo/shims.js'],
79
+
define: {
80
+
esbuild_app_dir:`"${config.kit.appDir}"`
81
+
}
82
+
}
83
+
```
84
+
48
85
## Changelog
49
86
50
87
[The Changelog for this package is available on GitHub](https://github.com/sveltejs/kit/blob/master/packages/adapter-node/CHANGELOG.md).
Copy file name to clipboardExpand all lines: packages/adapter-vercel/README.md
+31
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,37 @@ export default {
19
19
};
20
20
```
21
21
22
+
## Advanced Configuration
23
+
24
+
### esbuild
25
+
26
+
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.
27
+
28
+
For example, you may wish to add a plugin:
29
+
30
+
```js
31
+
adapterVercel({
32
+
esbuild(defaultOptions) {
33
+
return {
34
+
...defaultOptions,
35
+
plugins: []
36
+
};
37
+
}
38
+
});
39
+
```
40
+
41
+
The default options for this version are as follows:
42
+
43
+
```js
44
+
{
45
+
entryPoints: ['.svelte-kit/vercel/entry.js'],
46
+
outfile:`pathToLambdaFolder/index.js`,
47
+
bundle:true,
48
+
inject: ['pathTo/shims.js'],
49
+
platform:'node'
50
+
}
51
+
```
52
+
22
53
## Changelog
23
54
24
55
[The Changelog for this package is available on GitHub](https://github.com/sveltejs/kit/blob/master/packages/adapter-vercel/CHANGELOG.md).
0 commit comments