Skip to content
Meeko
Type to search the guides and the API reference. Open it from any page with / or Ctrl K; move with the arrow keys and open a result with Enter.
Get started

Contents

On this page

devtools

Mounts the Meeko DevTools panel inside the page in meeko dev, without application code, in the chosen corner.

configuration Since 1.8.0

devtools enables Meeko DevTools in meeko dev: with true, meeko dev mounts the panel inside the page in every document, without import() or mountDevtoolsPanel() in the application. This is the recommended approach since 1.8, like devtools: true in Nuxt. The default is false: upgrading within 1.x does not show the panel until you request it.

The panel never reaches meeko build, meeko start, meeko preview or prerendered pages: only meeko dev adds it.

Usage#

ts
// meeko.config.ts
import { defineMeekoConfig } from "@meekojs/meeko/framework";

export default defineMeekoConfig({ devtools: true });

Type#

MeekoConfig.devtools

ts
readonly devtools?: boolean | MeekoDevtoolsConfig

MeekoDevtoolsConfig

ts
interface MeekoDevtoolsConfig {
	readonly panel?: boolean
	readonly position?: DevtoolsPanelPosition
}

Options#

devtools is a boolean or an object. An object enables DevTools: without panel, the panel mounts just as with true.

Option Type Default Description
panel boolean true Mounts the panel inside the page in meeko dev.
position "bottom-right" | "bottom-left" | "top-right" | "top-left" "bottom-right" Window corner where the panel is fixed.

Result#

With the panel enabled, meeko dev adds a <script type="module"> to each document's <head> (with the CSP nonce, if any) that loads @meekojs/meeko/devtools-ui and calls mountDevtoolsPanel({ position }). The panel connects to the window.__MEEKO_DEVTOOLS__ hook when the page hydrates.

The panel uses Meeko colors, light or dark according to the system or the page's data-theme; it minimizes to a pill with the new event count (Alt+Shift+M) and moves to another corner by dragging its handle. It remembers both in localStorage; changing position in the configuration overrides the remembered corner. See Appearance, minimizing and moving.

Without devtools (or with false or { panel: false }), meeko dev adds nothing. The hook still exists in development, so the Chrome extension and editor bridge work with or without this option.

Examples#

In another corner#

ts
import { defineMeekoConfig } from "@meekojs/meeko/framework";

export default defineMeekoConfig({ devtools: { position: "bottom-left" } });

Only when requested#

ts
import { defineMeekoConfig } from "@meekojs/meeko/framework";

export default defineMeekoConfig({ devtools: process.env.MEEKO_DEVTOOLS === "1" });
sh
MEEKO_DEVTOOLS=1 npm run dev

Common mistakes#

A nonexistent corner#

Incorrectts
export default defineMeekoConfig({ devtools: { position: "middle" } as never });

meeko dev, meeko build, meeko check and meeko routes stop with …/meeko.config.ts: devtools.position debe ser "bottom-right", "bottom-left", "top-right" o "top-left", and meeko check also reports TS2322 on that line. A value that is neither a boolean nor an object reports devtools debe ser un booleano o un objeto { panel?: boolean, position?: … }; an extra field reports devtools: campo desconocido ….

Correctts
import { defineMeekoConfig } from "@meekojs/meeko/framework";
export default defineMeekoConfig({ devtools: { position: "top-left" } });

Mount it twice#

Incorrectts
// app/plugins/devtools.client.ts, with devtools: true in meeko.config.ts
if (import.meta.env.DEV) {
  const { mountDevtoolsPanel } = await import("@meekojs/meeko/devtools-ui");
  mountDevtoolsPanel();
}

If your custom mount runs first, meeko dev respects it and does not add another; if it runs afterwards, there are two panels. Use one approach: devtools in the configuration or manual mounting, which still works for a custom container (container).

Correctts
import { defineMeekoConfig } from "@meekojs/meeko/framework";
export default defineMeekoConfig({ devtools: true });

Notes#

  • Development only. Neither the script nor @meekojs/meeko/devtools-ui exists in meeko build, meeko start, meeko preview or prerendered pages.
  • Module keys. devtools is a built-in Meeko option since 1.8: a module with meta.configKey: "devtools" no longer loads and must use another key.
  • Development. Changing meeko.config.ts requires restarting meeko dev.

Was this page helpful?

Add a comment

It is sent when you choose “Yes” or “No”. Only the page, your answer and the comment are stored: no cookies and no personal data.

0 of 2000 characters

Edit on GitHub: docs/en/reference/config/config-devtools.md