Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vite: Cloudflare Proxy plugin #8749

Merged
merged 24 commits into from
Feb 15, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
update presets docs
  • Loading branch information
pcattori committed Feb 15, 2024
commit cf845a39bf13e0026099eb70d4d014d831f5d81a
37 changes: 18 additions & 19 deletions docs/future/presets.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,6 @@ Presets can only do two things:

The config returned by each preset is merged in the order they were defined. Any config directly passed to the Remix Vite plugin will be merged last. This means that user config will always take precedence over any presets.

## Using a preset

Presets are designed to be published to npm and used within your Vite config.

```ts filename=vite.config.ts lines=[3,11]
import { vitePlugin as remix } from "@remix-run/dev";
import { defineConfig } from "vite";
// TODO: better example
import { somePreset } from "some-preset";

export default defineConfig({
plugins: [
remix({
presets: [somePreset()],
}),
],
});
```

## Creating a preset

Presets conform to the following `Preset` type:
Expand Down Expand Up @@ -114,5 +95,23 @@ export function myCoolPreset(): Preset {

The `remixConfigResolved` hook should only be used in cases where it would be an error to merge or override your preset's config.

## Using a preset

Presets are designed to be published to npm and used within your Vite config.

```ts filename=vite.config.ts lines=[3,8]
import { vitePlugin as remix } from "@remix-run/dev";
import { defineConfig } from "vite";
import { myCoolPreset } from "remix-preset-cool";

export default defineConfig({
plugins: [
remix({
presets: [myCoolPreset()],
}),
],
});
```

[remix-vite]: ./vite
[server-bundles]: ./server-bundles
Loading