@analogjs/platform
Version:
The fullstack meta-framework for Angular
22 lines (21 loc) • 968 B
TypeScript
import { Plugin } from 'vite';
import { Options } from './options.js';
/**
* Router plugin that handles route file discovery and hot module replacement.
*
* This plugin provides three main functionalities:
* 1. Route invalidation when files are added/deleted (HMR workaround)
* 2. Dynamic route file discovery and import generation
* 3. Content route file discovery for markdown and Analog content
*
* @param options Configuration options for the router plugin
* @returns Array of Vite plugins for route handling
*
* IMPORTANT: This plugin uses tinyglobby for file discovery.
* Key behavior with { dot: true, absolute: true }:
* - Returns absolute paths for ALL discovered files
* - Path normalization is required to match expected output format
* - Files within project root must use relative paths in object keys
* - Files outside project root keep absolute paths in object keys
*/
export declare function routerPlugin(options?: Options): Plugin[];