Interactive Learning Platform Nuxt layer

Isolated learning atmosphere · v4.x

← Back to writing
All tutorials
Nuxt v4.xIntermediate Released July 28, 2026 · ~30 min

Nuxt Layers: Going Further

Based on the official Nuxt release notes

A folder in layers/ proves the boundary. A package makes it real: versioned, installable, and impossible to import from by accident.

This series takes layers/learn and turns it into @vvantol2000/learn-layer — the package that serves the page you're reading — then works through everything a layer can legitimately own and the one class of bug that only appears once your layer lives in node_modules.

The relative-path trap in step three costs most people an afternoon. It fails silently in development and only breaks once the layer is consumed from somewhere else. Read that step before you publish anything.

What we cover here#

  1. From Folder to Workspace Package — main, files, workspace:*, and extending by name.
  2. What a Layer Can Own — pages, composables, server routes, and a Nuxt Content collection of its own.
  3. Paths, Aliases and the Trap — why ~/assets/x.css in a layer points at the consumer's assets, and what to write instead.

Where it goes next#

How this series works#

Each step follows the same path: What it is → Why you'd care → Before → After → Do it yourself → Gotchas → Recap.

Prerequisite: The Basics — you should know what extends does and how precedence works.