UNPKG

nuxt

Version:

Nuxt is a free and open-source framework with an intuitive and extendable way to create type-safe, performant and production-grade full-stack web applications and websites with Vue.js.

24 lines (23 loc) 615 B
import { defineNuxtPlugin } from "../nuxt.js"; export default defineNuxtPlugin({ name: "nuxt:browser-devtools-timing", enforce: "pre", setup(nuxtApp) { nuxtApp.hooks.beforeEach((event) => { event.__startTime = performance.now(); }); nuxtApp.hooks.afterEach((event) => { performance.measure(event.name, { // @ts-expect-error __startTime is not a public API start: event.__startTime, detail: { devtools: { dataType: "track-entry", track: "nuxt", color: "tertiary-dark" } } }); }); } });