vike
Version:
The Framework *You* Control - Next.js & Nuxt alternative for unprecedented flexibility and dependability.
30 lines (29 loc) • 1.37 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.onLoad = onLoad;
const assertIsNotBrowser_js_1 = require("../../utils/assertIsNotBrowser.js");
const assertNodeVersion_js_1 = require("../../utils/assertNodeVersion.js");
const assert_js_1 = require("../../utils/assert.js");
const require_shim_1 = require("@brillout/require-shim");
const isErrorDebug_js_1 = require("../shared/isErrorDebug.js");
function onLoad() {
(0, assertIsNotBrowser_js_1.assertIsNotBrowser)();
(0, assertNodeVersion_js_1.assertNodeVersion)();
if ((0, isErrorDebug_js_1.isErrorDebug)())
(0, assert_js_1.setAlwaysShowStackTrace)();
addEcosystemStamp();
(0, require_shim_1.installRequireShim)();
}
// Used by:
// - Telefunc (to detect the user's stack https://github.com/brillout/telefunc/blob/8288310e88e06a42b710d39c39fb502364ca6d30/telefunc/utils/isVikeApp.ts#L4)
function addEcosystemStamp() {
const g = globalThis;
g._isVikeApp =
/* Don't set to true so that consumers do `!!globalThis._isVikeApp` instead of `globalThis._isVikeApp === true`.
true
*/
// We use an object so that we can eventually, in the future, add helpful information as needed. (E.g. the Vike version, or global settings.)
{};
// We keep the old stamp for older Telefunc versions
g._isVitePluginSsr = true;
}