UNPKG

vike

Version:

The Framework *You* Control - Next.js & Nuxt alternative for unprecedented flexibility and dependability.

24 lines (23 loc) 916 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.debug = debug; exports.setCreateDebugger = setCreateDebugger; // Using createDebugger() for isomorphic code without bloating the client-side. // On the server-side, this is just a transparent proxy. // On the client-side, this is an empty shell. const getGlobalObject_js_1 = require("../../utils/getGlobalObject.js"); const globalObject = (0, getGlobalObject_js_1.getGlobalObject)('route/debug.ts', {}); function debug(...args) { // Client-side => does nothing if (!globalObject.createDebugger) return; // Server-side => just a proxy if (!globalObject.debug) { globalObject.debug = globalObject.createDebugger('vike:routing'); } globalObject.debug(...args); } // Called only on the server-side function setCreateDebugger(createDebugger) { globalObject.createDebugger = createDebugger; }