@sveltejs/adapter-netlify 1.0.0-next.36 → 1.0.0-next.37
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.
- package/README.md +7 -37
- package/files/cjs/handler-bc05d78e.js +6600 -0
- package/files/cjs/handler.js +17 -0
- package/files/cjs/multipart-parser-b87ea3e5.js +452 -0
- package/files/esm/handler-5924cdbc.js +6589 -0
- package/files/esm/handler.js +9 -0
- package/files/esm/multipart-parser-1104e57c.js +450 -0
- package/index.d.ts +1 -6
- package/index.js +165 -54
- package/package.json +11 -3
- package/files/entry.js +0 -71
- package/files/shims.js +0 -1
package/README.md
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
# adapter-netlify
|
|
2
2
|
|
|
3
|
-
Adapter for Svelte apps that creates a Netlify app, using
|
|
4
|
-
|
|
5
|
-
This is very experimental; the adapter API isn't at all fleshed out, and things will definitely change.
|
|
3
|
+
Adapter for Svelte apps that creates a Netlify app, using serverless functions for dynamically generating pages.
|
|
6
4
|
|
|
7
5
|
## Installation
|
|
8
6
|
|
|
@@ -19,7 +17,11 @@ import adapter from '@sveltejs/adapter-netlify';
|
|
|
19
17
|
|
|
20
18
|
export default {
|
|
21
19
|
kit: {
|
|
22
|
-
adapter: adapter(
|
|
20
|
+
adapter: adapter({
|
|
21
|
+
// if true, will split your app into multiple functions
|
|
22
|
+
// instead of creating a single one for the entire app
|
|
23
|
+
split: false
|
|
24
|
+
}),
|
|
23
25
|
target: '#svelte'
|
|
24
26
|
}
|
|
25
27
|
};
|
|
@@ -41,7 +43,7 @@ You may build your app using functionality provided directly by SvelteKit withou
|
|
|
41
43
|
|
|
42
44
|
### Using Netlify Redirect Rules
|
|
43
45
|
|
|
44
|
-
During compilation
|
|
46
|
+
During compilation, redirect rules are automatically appended to your `_redirects` file. (If it doesn't exist yet, it will be created.) That means:
|
|
45
47
|
|
|
46
48
|
- `[[redirects]]` in `netlify.toml` will never match as `_redirects` has a [higher priority](https://docs.netlify.com/routing/redirects/#rule-processing-order). So always put your rules in the [`_redirects` file](https://docs.netlify.com/routing/redirects/#syntax-for-the-redirects-file).
|
|
47
49
|
- `_redirects` shouldn't have any custom "catch all" rules such as `/* /foobar/:splat`. Otherwise the automatically appended rule will never be applied as Netlify is only processing [the first matching rule](https://docs.netlify.com/routing/redirects/#rule-processing-order).
|
|
@@ -66,38 +68,6 @@ During compilation a required "catch all" redirect rule is automatically appende
|
|
|
66
68
|
node_bundler = "esbuild"
|
|
67
69
|
```
|
|
68
70
|
|
|
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.
|
|
94
|
-
outfile: '.netlify/functions-internal/__render.js',
|
|
95
|
-
bundle: true,
|
|
96
|
-
inject: ['pathTo/shims.js'],
|
|
97
|
-
platform: 'node'
|
|
98
|
-
}
|
|
99
|
-
```
|
|
100
|
-
|
|
101
71
|
## Changelog
|
|
102
72
|
|
|
103
73
|
[The Changelog for this package is available on GitHub](https://github.com/sveltejs/kit/blob/master/packages/adapter-netlify/CHANGELOG.md).
|