remix
import { remix } from "@pitlane/vite-plugin-remix";function remix(options?): PluginOption;Wires Remix 3 into a Vite or Vite+ project: multi-environment builds
(dist/ssr + dist/client) with an asset manifest for
createAssetResolver(), portable clientEntry(import.meta.url, …) island
identities that render({ assets }) resolves, dev serving through the app's
fetch handler, prerendering, and a preview server for the production build.
During vite dev it also installs hot module replacement: component edits
swap in place through the remix/component-hmr transforms, and edits to
modules the browser never loads broadcast a server:update event. An app
whose browser entry passes its run() runtime to revalidate from
@pitlane/vite-plugin-remix/hmr on that event refetches the current page
through the app's fetch handler, keeping hydrated island state. Both are
dev-only.
Platform-agnostic by design: deploy targets compose alongside it in the
plugin array (@cloudflare/vite-plugin, @netlify/vite-plugin,
nitro/vite), or the built fetch handler runs directly on Node, Bun, and
Deno.
Parameters
options?
RemixPluginOptions = {}
Entry modules, SPA mode, prerendering, assets, and dev serving; see RemixPluginOptions
Returns
PluginOption
The plugins, passed to Vite as one entry of plugins
Throws
Error when server: false is combined with prerender
See
Examples
import { remix } from "@pitlane/vite-plugin-remix";
import { defineConfig } from "vite";
export default defineConfig({
plugins: [remix()],
});SPA mode, with no server and index.html as the entry
import { remix } from "@pitlane/vite-plugin-remix";
import { defineConfig } from "vite";
export default defineConfig({
plugins: [remix({ server: false })],
});