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.

ModuleAutoImport

interfaz Since 1.2.0

Archivo de autoimport que añade un módulo con meeko.addAutoImports.

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

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

Declaración #

ts
interface ModuleAutoImport {
	readonly name: string
	readonly as?: string
	readonly from: string | URL
	readonly type?: boolean
	readonly scope?: 'app' | 'client' | 'server' | 'shared'
	readonly componentOnly?: boolean
}

Example #

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

const entries: ModuleAutoImport[] = [
  { name: "useAccent", from: "@acme/accent/runtime" },
  { name: "format", as: "formatDate", from: "date-fns", scope: "shared" },
  { name: "Accent", from: "@acme/accent/runtime", type: true },
];

Propiedades #

name #

propiedad sólo lectura

readonly name: string

Nombre exportado por from.

as #

propiedad sólo lectura opcional

readonly as?: string

Nombre con el que se usa sin import; por defecto, name.

from #

propiedad sólo lectura

readonly from: string | URL

Origen: un especificador de paquete ("@acme/theme/runtime"), una ruta absoluta, una URL file: o una ruta relativa a la raíz del proyecto ("../macros/shared/modules/theme/use-theme.ts").

type #

propiedad sólo lectura opcional

readonly type?: boolean

true si sólo es un tipo; se importa con import type.

scope #

propiedad sólo lectura opcional

readonly scope?: 'app' | 'client' | 'server' | 'shared'

Dónde se puede usar: "app" (componentes y app/, en el navegador y en SSR, el valor por defecto), "client" (sólo navegador), "server" (sólo servidor) o "shared" (en todas partes).

componentOnly #

propiedad sólo lectura opcional

readonly componentOnly?: boolean

Sólo en componentes y módulos de app/ que también se ejecutan en el navegador; no en server/.

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