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

extends

The former name of layers, still supported in 1.x without a warning; its folders come before those in layers.

configuration Since 1.0.0

extends was the name of layers through 1.1. It accepts the same values (project folders with app/pages) and applies the same rules, and continues to work throughout 1.x without a warning. The only difference is the order: its folders come before those in layers.

In a new project, use layers.

Usage#

ts
// meeko.config.ts for a 1.0 or 1.1 project
import { defineMeekoConfig } from "@meekojs/meeko/framework";

export default defineMeekoConfig({
  extends: ["./layers/base"],
});

Type#

MeekoConfig.extends

ts
readonly extends?: readonly string[]

Options#

Value Type Default Description
extends readonly string[] [] Project folders with app/pages, like those in layers.

Result#

The extends folders are added as layers immediately after the application and before the layers folders. This order determines which named layout wins when two sources declare it, and the search order for the ~/, @/, #shared/ and #server/ aliases.

Examples#

Migrating to layers#

ts
// Before (1.1)
// export default defineMeekoConfig({ extends: ["./layers/base", "./layers/admin"] });

// After (1.2 or later): the same order.
import { defineMeekoConfig } from "@meekojs/meeko/framework";
export default defineMeekoConfig({ layers: ["./layers/base", "./layers/admin"] });

Using both during a migration#

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

export default defineMeekoConfig({
  extends: ["./layers/legacy"], // first
  layers: ["./layers/base"],    // after
});

Common mistakes#

The same folder in extends and layers#

Incorrectts
export default defineMeekoConfig({ extends: ["./layers/base"], layers: ["./layers/base"] });

Raíz de fuentes de Meeko repetida: <ruta>: a folder can only be one source.

Correctts
import { defineMeekoConfig } from "@meekojs/meeko/framework";
export default defineMeekoConfig({ layers: ["./layers/base"] });

A folder outside the project#

Incorrectts
export default defineMeekoConfig({ extends: ["../outside"] });

meeko dev, meeko build, meeko check and meeko routes stop with layer ../outside sale de la raíz del proyecto <ruta>.

Correctts
import { defineMeekoConfig } from "@meekojs/meeko/framework";
export default defineMeekoConfig({ extends: ["./layers/outside"] });

Notes#

  • No warning. Unlike folders in modules, extends does not print a warning and is not scheduled for removal in 1.x.
  • Editor. Like layers, the editor reads it without executing the configuration if it is a literal array of strings.

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-extends.md