Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ PROTOCOL_HEADER=x-forwarded-proto HOST_HEADER=x-forwarded-host node build

If `adapter-node` can't correctly determine the URL of your deployment, you may experience this error when using [form actions](form-actions):

> [!NOTE] Cross-site POST form submissions are forbidden
> Cross-site POST form submissions are forbidden

### `ADDRESS_HEADER` and `XFF_DEPTH`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,14 @@ export default defineConfig({
adapter: adapter({
// See below for an explanation of these options
edge: false,
split: false
split: false,
publish: 'build'
})
})
]
});
```

Then, make sure you have a [netlify.toml](https://docs.netlify.com/configure-builds/file-based-configuration) file in the project root. This will determine where to write static assets based on the `build.publish` settings, as per this sample configuration:

```toml
[build]
command = "npm run build"
publish = "build"
```

If the `netlify.toml` file or the `build.publish` value is missing, a default value of `"build"` will be used.

> [!NOTE] If you have set the publish directory in the Netlify UI to something else then you will need to set it in `netlify.toml` too.

## Options

### `edge`
Expand All @@ -53,6 +42,10 @@ If `true`, your app will be deployed as a [Netlify Edge Function](https://docs.n

If `true`, your app will be split into multiple functions instead of a single one for the entire app.

### `publish`

The directory to write prerendered pages and static assets (the contents of `static`, plus client-side JS and CSS generated by SvelteKit) to. It defaults to `build`.

## Netlify alternatives to SvelteKit functionality

You may build your app using functionality provided directly by SvelteKit without relying on any Netlify functionality. Using the SvelteKit versions of these features will allow them to be used in dev mode, tested with integration tests, and to work with other adapters should you ever decide to switch away from Netlify. However, in some scenarios you may find it beneficial to use the Netlify versions of these features. One example would be if you're migrating an app that's already hosted on Netlify to SvelteKit.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,9 @@ Checks whether this is an action failure thrown by `fail`.
<div class="ts-block">

```dts
function isActionFailure(e: unknown): e is ActionFailure;
function isActionFailure(
e: unknown
): e is ActionFailure<undefined>;
```

</div>
Expand Down
Loading