Conversation
Introduces `evlog/vite` — a Vite plugin that brings Nuxt-level DX to any Vite-based framework (React, SvelteKit, Astro, SolidStart, etc.). Features: - Zero-config auto-init via Vite `define` (no virtual import needed) - Opt-in auto-imports for `log`, `createEvlogError`, `parseError` - Build-time log stripping (production only) - Source location injection (`__source: 'file:line'`) - Client-side auto-init via `transformIndexHtml` - `evlog/client` re-export for generic Vite usage Also wires strip and source-location into the Nuxt module via `addVitePlugin()` with no breaking changes.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Thank you for following the naming conventions! 🙏 |
Benchmark reportBundle size
|
Merging this PR will degrade performance by 65.13%
Performance Changes
Comparing Footnotes |
- Create examples/vite/ standalone Hono + Vite app showcasing auto-init, auto-imports, strip, source-location, and client-inject - Update examples/sveltekit/ to use evlog/vite plugin, removing manual initLogger() call in hooks.server.ts - Add example:vite script to root package.json
vite-node doesn't serve static files or process index.html. Replace index.html/client.ts with an inline HTML UI served by Hono, matching the pattern from the hono example.
commit: |
There was a problem hiding this comment.
Pull request overview
Adds an evlog/vite build-time plugin and supporting client entrypoint to improve developer experience in Vite-based apps (auto-init, optional auto-imports, stripping, source locations, and client init), and wires parts of it into the Nuxt module and examples/docs.
Changes:
- Introduce
evlog/viteplugin (auto-init, auto-imports, strip, source location, client inject) plus a new publicevlog/cliententry. - Integrate strip + source-location plugins into the Nuxt module via
addVitePlugin(). - Add Vite-focused tests, docs updates, and new Vite example (plus SvelteKit example switching to Vite plugin auto-init).
Reviewed changes
Copilot reviewed 32 out of 33 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| skills/review-logging-patterns/SKILL.md | Documents Vite plugin usage pattern for Vite-based frameworks. |
| packages/evlog/tsdown.config.ts | Adds build entries for vite + client and updates bundling config. |
| packages/evlog/test/vite/strip.test.ts | Tests production stripping of log.*() calls. |
| packages/evlog/test/vite/source-location.test.ts | Tests __source injection behavior. |
| packages/evlog/test/vite/index.test.ts | Tests plugin composition and ordering. |
| packages/evlog/test/vite/client-inject.test.ts | Tests HTML injection for client init. |
| packages/evlog/test/vite/auto-init.test.ts | Tests define-time auto-init config injection. |
| packages/evlog/test/vite/auto-imports.test.ts | Tests symbol detection and auto-import injection. |
| packages/evlog/src/vite/utils.ts | Shared AST walking + transform filtering helpers. |
| packages/evlog/src/vite/types.ts | Public types for Vite plugin options. |
| packages/evlog/src/vite/strip.ts | Implements build-time log-level stripping. |
| packages/evlog/src/vite/source-location.ts | Implements dev/prod __source injection. |
| packages/evlog/src/vite/index.ts | Main evlog/vite entry that returns a plugin array. |
| packages/evlog/src/vite/client-inject.ts | Injects initLog() module script into HTML. |
| packages/evlog/src/vite/auto-init.ts | Injects __EVLOG_CONFIG__ define for auto-init. |
| packages/evlog/src/vite/auto-imports.ts | Adds optional auto-imports + generates auto-imports.d.ts. |
| packages/evlog/src/nuxt/module.ts | Adds Nuxt options for strip/sourceLocation and installs Vite plugins. |
| packages/evlog/src/logger.ts | Auto-inits logger when __EVLOG_CONFIG__ is defined. |
| packages/evlog/src/client.ts | New evlog/client re-export entrypoint. |
| packages/evlog/package.json | Exports ./vite + ./client, adds deps/peer dep updates. |
| package.json | Adds example:vite root script. |
| examples/vite/vite.config.ts | Demonstrates evlog/vite usage. |
| examples/vite/tsconfig.json | TS config for the new Vite example. |
| examples/vite/src/utils/billing.ts | Example utility producing logs for strip/sourceLocation demo. |
| examples/vite/src/ui.ts | Example UI page describing plugin features. |
| examples/vite/src/server.ts | Hono server to exercise example routes/logging. |
| examples/vite/README.md | Documents the Vite example and claimed features. |
| examples/vite/package.json | Adds the new example package and scripts/deps. |
| examples/sveltekit/vite.config.ts | Adds evlog/vite plugin to SvelteKit example. |
| examples/sveltekit/src/hooks.server.ts | Removes manual initLogger() in favor of Vite auto-init. |
| bun.lock | Updates lockfile for new deps/examples. |
| apps/docs/app/components/features/FeaturePerformance.vue | Formatting-only template changes. |
| AGENTS.md | Documents the new Vite plugin and repo structure update. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Add dedicated Vite plugin documentation page covering auto-init, debug stripping, source location, and auto-imports. Update landing page and framework overview to reference the plugin. Add Vite icon to the "Your Stack. Covered" section. Update SvelteKit docs to use the Vite plugin for initialization. Add callouts to Express, Hono, Fastify, Elysia, and Standalone docs for Vite-based setups.
There was a problem hiding this comment.
Pull request overview
Adds an evlog/vite build-time plugin to the evlog package (plus a new evlog/client entrypoint), updates Nuxt to reuse the same strip/source-location transforms, and expands docs/examples to promote the Vite-based setup.
Changes:
- Introduces
evlog/viteplugin suite: auto-init viadefine, optional auto-imports +.d.tsgeneration, optional client HTML injection, production log stripping, and source-location injection. - Exposes new public entrypoints/exports (
evlog/vite,evlog/client) and wires build + peer deps accordingly. - Adds tests, docs, and a new Vite example; updates SvelteKit example/docs to use the Vite plugin instead of manual
initLogger().
Reviewed changes
Copilot reviewed 43 out of 45 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| skills/review-logging-patterns/SKILL.md | Adds Vite plugin guidance to the “review logging patterns” skill docs. |
| packages/evlog/tsdown.config.ts | Adds build entries for vite + client; updates externals/inlining for new deps. |
| packages/evlog/test/vite/strip.test.ts | Unit tests for the strip transform behavior. |
| packages/evlog/test/vite/source-location.test.ts | Unit tests for source-location injection. |
| packages/evlog/test/vite/index.test.ts | Unit tests for plugin composition + option-driven inclusion/order. |
| packages/evlog/test/vite/client-inject.test.ts | Unit tests for HTML injection plugin. |
| packages/evlog/test/vite/auto-init.test.ts | Unit tests for define-based auto-init config serialization. |
| packages/evlog/test/vite/auto-imports.test.ts | Unit tests for auto-import transform + .d.ts behavior. |
| packages/evlog/src/vite/utils.ts | Shared AST walk + transform filtering utilities for Vite plugins. |
| packages/evlog/src/vite/types.ts | Type definitions for Vite plugin options (autoImports/client/strip/sourceLocation). |
| packages/evlog/src/vite/strip.ts | Implements production stripping of selected log.<level>() calls. |
| packages/evlog/src/vite/source-location.ts | Implements dev/prod source location injection into object-form log calls. |
| packages/evlog/src/vite/index.ts | Main evlog/vite entry: returns ordered plugin array based on options. |
| packages/evlog/src/vite/client-inject.ts | Injects initLog() client boot script via transformIndexHtml. |
| packages/evlog/src/vite/auto-init.ts | Injects __EVLOG_CONFIG__ via Vite define. |
| packages/evlog/src/vite/auto-imports.ts | Adds optional auto-imports + .d.ts generation for chosen symbols. |
| packages/evlog/src/nuxt/module.ts | Adds strip + sourceLocation options and wires them via addVitePlugin(). |
| packages/evlog/src/logger.ts | Auto-initializes via __EVLOG_CONFIG__ when present. |
| packages/evlog/src/client.ts | New evlog/client entrypoint re-exporting runtime client log APIs. |
| packages/evlog/package.json | Adds exports/typesVersions + peer deps metadata for ./vite and ./client. |
| package.json | Adds example:vite turbo script. |
| examples/vite/vite.config.ts | New Vite example config using evlog/vite. |
| examples/vite/tsconfig.json | TypeScript config for the new Vite example. |
| examples/vite/src/utils/billing.ts | Example utility that logs info/debug. |
| examples/vite/src/ui.ts | Example HTML UI for calling demo routes and rendering responses. |
| examples/vite/src/server.ts | Example Hono server demonstrating evlog logging + error handling. |
| examples/vite/README.md | Usage + feature overview for the new Vite example. |
| examples/vite/package.json | New example package definition and scripts. |
| examples/sveltekit/vite.config.ts | Adds evlog/vite to SvelteKit example’s Vite config. |
| examples/sveltekit/src/hooks.server.ts | Removes manual initLogger() in favor of Vite-plugin auto-init. |
| bun.lock | Lockfile updates for new deps/packages (vite, magic-string, acorn, example workspace). |
| apps/docs/content/3.core-concepts/10.vite-plugin.md | New docs page for the Vite plugin (features/options/compatibility). |
| apps/docs/content/2.frameworks/12.standalone.md | Adds a callout pointing vite-node users to evlog/vite. |
| apps/docs/content/2.frameworks/10.elysia.md | Mentions Vite plugin as an alternative to manual init; adds callout. |
| apps/docs/content/2.frameworks/09.fastify.md | Mentions Vite plugin as an alternative to manual init; adds callout. |
| apps/docs/content/2.frameworks/08.hono.md | Mentions Vite plugin as an alternative to manual init; adds callout. |
| apps/docs/content/2.frameworks/07.express.md | Mentions Vite plugin as an alternative to manual init; adds callout. |
| apps/docs/content/2.frameworks/03.sveltekit.md | Rewrites setup to use Vite plugin; removes manual init snippets. |
| apps/docs/content/2.frameworks/00.overview.md | Adds a “Vite Plugin” section linking to the new core-concept doc. |
| apps/docs/content/0.landing.md | Mentions Vite plugin capability in landing-page description copy. |
| apps/docs/app/components/features/FeaturePerformance.vue | Formatting-only changes to feature text markup. |
| apps/docs/app/components/features/FeatureFrameworks.vue | Adds Vite as a selectable item/link in frameworks section. |
| apps/docs/app/assets/icons/vite.svg | Adds Vite icon asset for docs UI. |
| AGENTS.md | Documents the new Vite plugin architecture/entrypoints for contributors. |
| .github/workflows/codspeed.yml | Excludes packages/evlog/src/vite/** changes from CodSpeed benchmark triggers. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Summary
evlog/vite— a Vite plugin that brings Nuxt-level DX to any Vite-based framework (React, SvelteKit, Astro, SolidStart, Qwik, etc.)define— no virtual import or manualinitLogger()neededlog,createEvlogError,parseErrorwith.d.tsgenerationlog.debug()stripping (production builds only)__source: 'file:line') for the simple log APItransformIndexHtmlevlog/clientpublic entrypointaddVitePlugin()(no breaking changes)Usage
Fixes EVL-62