@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 CHANGED
@@ -1,8 +1,6 @@
1
1
  # adapter-netlify
2
2
 
3
- Adapter for Svelte apps that creates a Netlify app, using a function for dynamic server rendering. A future version might use a function per route, though it's unclear if that has any real advantages.
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(), // currently the adapter does not take any options
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 a required "catch all" redirect rule is automatically appended to your `_redirects` file. (If it doesn't exist yet, it will be created.) That means:
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).