A Vite plugin that forwards browser console logs (console.log, console.warn, console.error, etc.) to the Vite dev server console. v2.0.1 is the latest stable release, requiring Vite ^6.0.0 || ^7.0.0. Released as a single-file TypeScript plugin under MIT. Differentiates from similar tools by being a minimal, no-dependency Vite plugin with configurable endpoints and log levels, and automatic buffering. Useful for debugging in environments where browser dev tools are inaccessible, such as mobile devices or CI pipelines.
npm install vite-console-forward-pluginVerified import paths — ran on the pinned version, not inferred.
Configures the plugin in vite.config.ts with enabled toggle, custom endpoint, and forwarded log levels.
Use vite-console-forward-plugin@1.0.0 if using Vite 5.
Use a unique endpoint path (e.g. '/__console_logs__') to avoid conflicts.
Set `enabled: false` and ensure the plugin is conditionally included only in dev config.
npm install vite-console-forward-plugin --save-dev
Use `import { consoleForwardPlugin } from 'vite-console-forward-plugin'`Either downgrade plugin to v1.0.0 or upgrade Vite to ^6.0.0 || ^7.0.0