import type { PluginOption } from 'vite'; import type { UiFilePaths } from '../../utils/config/cli-options'; import type { shouldApplySourcemaps } from '../../build/utils/should-apply-sourcemaps'; import { type TypeScriptErrorHolder } from './plugins/dt-error-overlay/dt-error-overlay-plugin'; /** * Builds the ordered plugin list for the Vite dev server. * * Order matters — each slot is intentional: * * 1. `dtSecurityVitePlugin` — Must be first; generates the CSRF session token, * validates it on proxied routes, and sets the Access-Control-Allow-Private-Network * header selectively. Replaces the former unconditional dt-private-network-access plugin. * 2. `react` — React Fast Refresh transform + optional compiler (opt-in via --enable-react-compiler). * 3. User Vite plugins — App-level vite plugins from `build.ui.plugins`. * 4. `excludeVendorFromSourceMap` — Optional; strips vendor source maps when sourcemaps are * enabled but `includeVendorSourceMaps` is false. * 5. `dtFunctionVitePlugin` — Proxies `/api/*` calls to esbuild-bundled functions. * 6. `dtAppfwVitePlugin` — App-framework (appfw) middleware. * 7. `dtCspVitePlugin` — Injects Content-Security-Policy headers (skipped when * `--no-security-hardening` is active). * 8. `dtWidgetVitePlugin` — Serves each widget document via Vite's transform * pipeline (HMR); must run before the router so it wins `/widgets/*` HTML routes. * 9. `dtRouterVitePlugin` — Handles app-level client-side routing. * 10. `dtHtmlPlugin` — Transforms `index.html` (injects scripts, base href, etc.). * 11. `dtSelfMonitoringVitePlugin` — Injects the self-monitoring agent when `app.selfMonitoringAgent` is set. * 12. `dtErrorOverlayPlugin` — Displays TypeScript errors as an in-browser overlay. * * TypeScript path aliases (`resolve.tsconfigPaths`) are handled natively by Vite * via the `resolve.tsconfigPaths` config option, not as a plugin. */ export declare function createDevPlugins(uiFilePaths: UiFilePaths | null, errorHolder: TypeScriptErrorHolder, userVitePlugins: PluginOption[], sourceMapOptions: ReturnType): PluginOption[];