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
18 changes: 18 additions & 0 deletions packages/vite-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,24 @@ The plugin accepts the following options:
- `redirects`: Configure URL redirects
- `staticFiles`: Configure static file serving

### EXPERIMENTAL: Building your app for deployment

The `build` options prepare your app's server build for deployment to Netlify, so you don't need a framework-specific
adapter or plugin. They're currently supported for TanStack Start and SolidStart 2 projects.

- `build.enabled` (boolean, default: `false`): Prepare the server build for deployment to Netlify
- `build.displayName` (string, default: `@netlify/vite-plugin server handler`): A display name for the serverless
function or edge function deployed to Netlify

```js
import { defineConfig } from 'vite'
import netlify from '@netlify/vite-plugin'

export default defineConfig({
plugins: [netlify({ build: { enabled: true } })],
})
```

## Usage

Add the plugin to your `vite.config.js` or `vite.config.ts`:
Expand Down
7 changes: 4 additions & 3 deletions packages/vite-plugin/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@ export interface NetlifyPluginOptions extends Features {
middleware?: boolean

/**
* DO NOT USE - build options, not meant for public use at this time.
* @private
* Options for building your app for deployment to Netlify.
*
* @experimental These options are experimental and only tested on some versions of some frameworks; see below.
*/
build?: {
/**
* Prepare the server build for deployment to Netlify - no additional configuration,
* plugins, or adapters necessary (default: false).
*
* This is currently only supported for TanStack Start projects.
* This is currently supported for TanStack Start and SolidStart 2 projects.
*/
enabled?: boolean
/**
Expand Down
Loading