Skip to content

Commit

Permalink
feat(nuxt): add URL serialiser for dev server logs
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed May 24, 2024
1 parent 2440007 commit a549b46
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/nuxt/src/app/plugins/dev-server-logs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 12,7 @@ const devRevivers: Record<string, (data: any) => any> = import.meta.server
? {}
: {
VNode: data => h(data.type, data.props),
URL: data => new URL(data),
}

export default defineNuxtPlugin(async (nuxtApp) => {
Expand Down
1 change: 1 addition & 0 deletions packages/nuxt/src/core/runtime/nitro/dev-server-logs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 14,7 @@ import { rootDir } from '#internal/dev-server-logs-options'

const devReducers: Record<string, (data: any) => any> = {
VNode: data => isVNode(data) ? { type: data.type, props: data.props } : undefined,
URL: data => data instanceof URL ? data.toString() : undefined,
}

interface NuxtDevAsyncContext {
Expand Down

0 comments on commit a549b46

Please sign in to comment.