Eleventy Plugin Baseline

A magic carpet ride

Table of Contents

assets-core

Note: The options API is still evolving; expect tweaks as the project grows.

What it does

  • Creates a virtual assets directory in Eleventy.
  • Resolves assets input/output directories and exposes them via _baseline.assets.
  • Adds a watch target under the resolved assets directory.

Defaults

  • Assets live under src/assets/ (via Eleventy dir settings).
  • Virtual dir key: fixed to assets (adds directories.assets if not already defined).
  • Respects Baseline verbose flag for logging.
  • Output: uses Eleventy’s dir.output (default dist) and mirrors dir.assets into it.

Options

  • None. Inherits global Baseline verbose.
  • Peer deps: none (built-in).

How it works

  • On eleventy.directories, resolves input/output/assets paths and defines directories.assets.
  • Exposes global data at _baseline.assets with input and output.
  • Adds a watch target under the resolved assets directory (**/*.{css,js,svg,png,jpeg,jpg,webp,gif,avif}).

Tips

  • Keep assets in src/assets/ to match the defaults.
  • Pair with the PostCSS/esbuild modules for processing src/assets/css/index.css and src/assets/js/index.js.
  • The watch target covers common image formats so edits trigger reloads during dev.
  • See the “Assets Pipeline” tutorial for a guided setup.
  • Tutorial: Assets Pipeline Quickstart

Previous: Modules

Next: assets-esbuild