import type { Plugin } from "rollup"; import type { IsomorphicRollupFs } from "../fs-iface"; export interface UiPageSourceManifestOptions { /** * Project root directory for resolving relative paths. */ rootDir: string; /** * Client directory for resolving relative path for HTML file. */ clientDir: string; /** * Glob patterns for files to exclude from the manifest. * Defaults to common build/dependency directories. * @default DEFAULT_EXCLUDE_PATTERNS */ excludePatterns?: string[]; /** * @deprecated No longer used. */ fs?: IsomorphicRollupFs; } export interface UiPageSourceManifest { /** * The HTML source file path (relative to rootDir). * Example: "src/client/index.html" */ html: string; /** * The main JavaScript/TypeScript entry point (relative to rootDir). * Example: "src/client/main.tsx" */ entry: string; /** * Array of all source file paths used in the bundle (relative to rootDir). * Example: ["src/client/app.tsx", "src/client/components/Button.tsx"] */ files: string[]; /** * Vendor chunks extracted from node_modules for this entry. * Each tuple is [fileName, contentHash]. * Example: [["vendor-react-dom--d217b640.jsdbx", "d217b640"]] */ vendors: [string, string][]; } /** * Rollup plugin that generates source manifest files for each entry point. * * This plugin tracks all source files used in each chunk and generates a JSON manifest * file that maps entry points to their source files. This is useful for: * - Source code tracking and versioning * - Debugging and development workflows * - IDE integrations that need to know the original source files * * @example * ```typescript * import { uiPageSourceManifest } from '@servicenow/isomorphic-rollup'; * * export default { * plugins: [ * uiPageSourceManifest({ * rootDir: "/project", * clientDir: "/project/src/client", * excludePatterns: ['**\/node_modules\/**', '**\/dist\/**'], * }), * ], * }; * ``` */ export default function uiPageSourceManifest(options: UiPageSourceManifestOptions): Plugin;