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 ExportDescriptionTarget Framework
@taserjs/plugin/viteVite plugin with HMR and optional HTTP serverVite, TanStack Start
@taserjs/plugin/nextNext.js configuration wrapperNext.js App Router
@taserjs/plugin/nitroNitro server moduleStandalone Nitro, Nuxt
@taserjs/plugin/webpackWebpack pluginWebpack
@taserjs/plugin/rspackRspack pluginRspack
@taserjs/plugin/rollupRollup pluginRollup
@taserjs/plugin/rolldownRolldown pluginRolldown
@taserjs/plugin/esbuildEsbuild pluginEsbuild

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.