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

Not translated yet

This page has not been translated into English yet, so it is shown in Spanish.

ModulePlugin

interfaz Since 1.2.0

Plugin de aplicación que añade un módulo con meeko.addPlugin.

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

Source code src/modules/define-meeko-module.ts:88

Declaración #

ts
interface ModulePlugin {
	readonly src: string | URL
	readonly mode?: 'client' | 'server' | 'universal'
	readonly options?: unknown
}

Example #

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

const plugin: ModulePlugin = {
  src: new URL("../macros/shared/runtime/theme.client.ts", import.meta.url),
  mode: "client",
  options: { storageKey: "theme" },
};

Propiedades #

src #

propiedad sólo lectura

readonly src: string | URL

Archivo que exporta por defecto definePlugin(...): ruta absoluta, URL file: o ruta relativa a la raíz del proyecto.

mode #

propiedad sólo lectura opcional

readonly mode?: 'client' | 'server' | 'universal'

Dónde se ejecuta: "client", "server" o "universal" (ambos). Por defecto, el sufijo del archivo (.client.ts, .server.ts) o "universal".

options #

propiedad sólo lectura opcional

readonly options?: unknown

Opciones serializables en JSON que recibe setup como segundo argumento. Las de un plugin "client" o "universal" llegan al navegador: no ponga secretos.

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: packages/meeko/src/modules/define-meeko-module.ts