Skip to content

You are reading the documentation for version 0.6, which is not the latest release.

Subpath exports

SpecifierWhat it provides
@mars-tech/vite-debug-pluginDefault export only: the plugin factory. CJS-callable (const mtDebug = require('@mars-tech/vite-debug-plugin') returns the function).
@mars-tech/vite-debug-plugin/helpersAll named exports: DEFAULT_COLORS, DEFAULT_PREFIX, DEFAULT_GLOBAL_NAME, plus every MT* type.
@mars-tech/vite-debug-plugin/eslintESLint flat config declaring the $debug global (default export), plus the mtDebugFlatConfig(opts) and mtDebugGlobals(name?, access?) helpers. See Usage.
@mars-tech/vite-debug-plugin/testingTest-runner setup: importing it installs a no-op $debug; also exports installMtDebugStub(opts). See Testing.
@mars-tech/vite-debug-plugin/testing/logThe setup module testLog: true auto-registers: it installs the real console logger. Registered for you; you don't import it directly. See Seeing $debug output in tests.
@mars-tech/vite-debug-plugin/clientTriple-slash reference target for the $debug global type augmentation.
ts
import mtDebug from "@mars-tech/vite-debug-plugin";
import {
  DEFAULT_COLORS,
  type MTLevel,
} from "@mars-tech/vite-debug-plugin/helpers";

The MT* types exported from /helpers include MTLevel, MTCallOptions, MTPluginOptions, MTDebug (the global: callable plus runtime controls and helpers) and MTColorMap. They are used, for example, to declare a custom globalName.