dt-app
Version:
The Dynatrace App Toolkit is a tool you can use from your command line to create, develop, and deploy apps on your Dynatrace environment.
29 lines (28 loc) • 1.53 kB
TypeScript
import type { Logger, Rolldown } from 'vite';
import type { Diagnostic } from '../diagnostic';
/**
* Creates a Vite Logger that routes build-level output through the CLI logger.
* Exported for reuse in widget and other Vite build configurations.
*
* - Info messages are forwarded as debug output only when `verbose` is true.
* - Warnings are suppressed because they are collected as structured
* diagnostics via `onwarn` and displayed through the diagnostic system.
* - Errors (e.g. plugin errors, internal Vite errors) are always forwarded
* to CLI error output so users always see them.
*
* @param verbose - When true, Vite info messages are emitted as debug output.
*/
export declare function createViteBuildLogger(verbose?: boolean): Logger;
/**
* Creates a warning handler for Rollup/Rolldown that converts build warnings
* into structured diagnostics.
*
* - Warnings originating from `node_modules` are silently ignored.
* - All other warnings are passed to `onWarning` as a {@link Diagnostic} with
* category, code, message, file path, line, and column populated.
* - The default Rolldown handler is always invoked so Vite's internal
* error-throwing behavior (e.g. for `UNRESOLVED_IMPORT`) is preserved.
*
* @param onWarning - Callback that receives each warning as a structured diagnostic.
*/
export declare function createWarningHandler(onWarning: (diagnostic: Diagnostic) => void): (warning: Rolldown.RolldownLog, defaultHandler: (warning: Rolldown.RolldownLog | string) => void) => void;