API Reference
@taserjs/plugin
API reference for @taserjs/plugin across Vite, Next.js, Nitro, and other bundlers.
The @taserjs/plugin package provides framework adapters and drives generation of src/.taserjs/routes.gen.ts during development and builds.
Path layout (serverDir, routesDir, outputDir, app) is configured in taserjs.config.ts via @taserjs/cli. Runtime URL prefixes use defineTaser().basePath(...) — never plugin options.
Exports Overview
| Subpath Export | Description | Target Framework |
|---|---|---|
@taserjs/plugin/vite | Vite plugin with HMR and optional HTTP server | Vite, TanStack Start |
@taserjs/plugin/next | Next.js configuration wrapper | Next.js App Router |
@taserjs/plugin/nitro | Nitro server module | Standalone Nitro, Nuxt |
@taserjs/plugin/webpack | Webpack plugin | Webpack |
@taserjs/plugin/rspack | Rspack plugin | Rspack |
@taserjs/plugin/rollup | Rollup plugin | Rollup |
@taserjs/plugin/rolldown | Rolldown plugin | Rolldown |
@taserjs/plugin/esbuild | Esbuild plugin | Esbuild |
The package root (@taserjs/plugin) is not part of the public API. Import a framework subpath.
Shared Options (TaserPluginOptions)
Used by Vite, Nitro, Webpack, Rspack, Rollup, Rolldown, and Esbuild:
import { taser } from "@taserjs/plugin/vite";
taser({
server: true,
serverEntry: "src/server.ts",
config: "./taserjs.config.ts",
});Prop
Type
Next.js (@taserjs/plugin/next)
import type { NextConfig } from "next";
import { createTaser } from "@taserjs/plugin/next";
const nextConfig: NextConfig = {};
const withTaser = createTaser({
config: "./taserjs.config.ts",
});
export default withTaser(nextConfig);NextTaserOptions
Only project resolution knobs — path layout stays in taserjs.config.ts:
Prop
Type
Nitro (@taserjs/plugin/nitro)
import { taser } from "@taserjs/plugin/nitro";
export default defineConfig({
modules: [taser({ standalone: true })],
});Uses the same TaserPluginOptions as Vite. See the Nitro guide.