@tanstack/router-plugin
Version:
Modern and scalable routing for React applications
21 lines (20 loc) • 819 B
text/typescript
import { Config } from '../config.cjs';
import type * as t from '@babel/types';
/**
* The HMR runtime to emit code for:
* - `'vite'`: ESM `import.meta.hot` with Vite accept-callback semantics.
* - `'webpack'`: `import.meta.webpackHot` with webpack / Rspack `module.hot`
* re-execution semantics.
*/
export type HmrStyle = 'vite' | 'webpack';
export type CreateRouteHmrStatementOpts = {
hmrStyle: HmrStyle;
targetFramework: Config['target'];
routeId?: string;
};
/**
* Dispatches to the HMR adapter of the bundler the plugin runs in. `hmrStyle`
* comes from the bundler-specific plugin entry (e.g. `rspack.ts` →
* `'webpack'`), not from user config.
*/
export declare function createRouteHmrStatement(stableRouteOptionKeys: Array<string>, opts: CreateRouteHmrStatementOpts): Array<t.Statement>;